Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

Daniel Chaves

Ajax + Formulario

Recommended Posts

Amigos.. tenho um formulario que busca o cep e os dados de cursos com ajax

 

mas na hora de gravar este formulario tudo que foi puxado pelo ajax não é gravado no bd.. alguem ai pode me ajudar

 

segue o código da página:

 

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /><script language="JavaScript" src="JavaScript/ValidaCPF.js"></script><script language="JavaScript" src="JavaScript/mascaras.js"></script><script language="JavaScript" src="JavaScript/ValidaData.js"></script><script language="JavaScript" src="JavaScript/ajax.js"></script><title>Untitled Document</title><style type="text/css"><!--.style1 {font-family: Arial, Helvetica, sans-serif}.style3 {font-family: Arial, Helvetica, sans-serif; font-size: 12px; }body,td,th {color: #003399;}a:link {color: #003399;}a:visited {color: #003399;}a:hover {color: #003399;}a:active {color: #003399;}.style5 {font-family: Arial, Helvetica, sans-serif;font-size: 12px;font-weight: bold;font-style: italic;}--></style><script>function trazcep(){cadastro.pegacep.value = cadastro.cep.valuecombocep();}//ESSA FUNÇÃO IRÁ TRAZER O ID DO ESTADO SELECIONADO NA PRIMEITA COMBO PARA PODERMOS PREENCHER A SEGUNDA E TERCEIRA COMBO.function trazdatas(){//AQUI TRAZEMOS APENAS O ID DE CADA ESTADO QUE FOR SELECIONADO. cadastro.idtreinamento.value = cadastro.treinamento.value;combodatas(); //CHAMA A FUNÇÃO AJAX QUE PREENCHER A COMBO CIDADE, ASSIM QUE É SELECIONADO UM REGISTRO NA COMBO1.}//AQUI É A FUNÇÃO QUE PREENCHE A COMBO CIDADE.//NÃO VOU ME APROFUNDAR NA EXPLICAÇÃO DESSA FUNÇÃO, JÁ QUE NOS OUTROS ARTIGOS QUE FIZ SOBRE AJAX, TEM A EXPLICAÇÃO SOBRE ELA.//MAS REPAREM NO NOME DA DIV QUE DEMOS AQUI: divcombouf. É O MESMO NOME QUE DEMOS NO ID DAQUELA DIV QUE EXISTE ANTES DA COMBO2 NA PÁGINA.function combodatas(){var combodatas = createXMLHTTP();combodatas.open("post", "pegadatas.asp", true);combodatas.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");combodatas.onreadystatechange=function(){if (combodatas.readyState==4){// abaixo o texto do gerado no arquivo executa.asp e colocado no divdocument.all.divcombodata.innerHTML = combodatas.responseText;}}combodatas.send("idtreinamento=" + cadastro.treinamento.value);}function combocep(){var combocep = createXMLHTTP();combocep.open("post", "pegacep.asp", true);combocep.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");combocep.onreadystatechange=function(){if (combocep.readyState==4){// abaixo o texto do gerado no arquivo executa.asp e colocado no divdocument.all.divcombocep.innerHTML = combocep.responseText;}}combocep.send("pegacep=" + cadastro.cep.value);}//AQUI É A FUNÇÃO QUE SERÁ PREENCHIDA DE ACORDO COM O REGISTRO SELECIONADO NA COMBO1 E NA COMBO2.//A EXPLICAÇÃO DA FUNÇÃO ACIMA VALE PARA ESSA TAMBÉM, JÁ QUE SÃO IGUAIS.</script><script LANGUAGE="JavaScript"><!-- Original: Cyanide_7 (leo7278@hotmail.com) --><!-- Web Site: [url="http://members.xoom.com/cyanide_7"]http://members.xoom.com/cyanide_7[/url] --><!-- This script and many more are available free online at --><!-- The JavaScript Source!! [url="http://javascript.internet.com"]http://javascript.internet.com[/url] --><!-- Beginvar isNN = (navigator.appName.indexOf("Netscape")!=-1);function autoTab(input,len, e) {var keyCode = (isNN) ? e.which : e.keyCode; var filter = (isNN) ? [0,8,9] : [0,8,9,16,17,18,37,38,39,40,46];if(input.value.length >= len && !containsElement(filter,keyCode)) {input.value = input.value.slice(0, len);input.form[(getIndex(input)+1) % input.form.length].focus();}function containsElement(arr, ele) {var found = false, index = 0;while(!found && index < arr.length)if(arr[index] == ele)found = true;elseindex++;return found;}function getIndex(input) {var index = -1, i = 0, found = false;while (i < input.form.length && index == -1)if (input.form[i] == input)index = i;else i++;return index;}return true;}// End --></script><link href="pd_styles.css" rel="stylesheet" type="text/css" /><style type="text/css"><!--.style6 {color: #FFFFFF}--></style></head><body><table width="508" cellpadding="0" cellspacing="0"><tr><td width="30"> </td><td><table border="0" cellspacing="0" cellpadding="0" width="100%"><tr><td valign="top"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tr><td valign="top" class="style1"><p> </p></td><td valign="top" class="style1"> </td><td valign="top" ><div align="right" class="style5"><a href="FAQ_LEI.asp"></a></div></td></tr><tr><td valign="top" bgcolor="#CCCCFF" class="style1"><p><strong>Ficha de Inscrição </strong> </p></td><td valign="top" bgcolor="#CCCCFF" class="style1"> </td><td valign="top" bgcolor="#CCCCFF" > </td></tr><tr><td valign="top" bgcolor="#FFFFFF" class="style1 style6"> </td><td valign="top" bgcolor="#FFFFFF" class="style1 style6"> </td><td valign="top" bgcolor="#FFFFFF" ><span class="style6"></span></td></tr></table></td></tr><tr><td><form id="form1" name="cadastro" method="POST" onsubmit="return ValidaForm()" action="confirma_inscricao.asp" onsubmit="return ValidaForm()"><table width="448" cellpadding="0" cellspacing="0"><tr><td width="121" height="30" valign="middle"><p align="right" class="style3"><strong>Treinamento:</strong> </p></td><td width="9" height="30"> </td><td height="30" colspan="5" valign="middle"> <select class="combo_inscricoes" id="estado" name="treinamento" onchange="trazdatas();" size="1"><option value="0">Selecione!</option><%sqlstmt = "Select * From tipo_treinamento order by cod_tipo_treinamento asc"Set rs = Server.CreateObject("ADODB.Recordset")rs.Open sqlstmt, connDo While NOT rs.EOF%><option value="<%Response.Write(rs("cod_tipo_treinamento"))%>" <%=selected%>><%=rs("nome")%></option><%rs.MoveNextLooprs.Close%></select></td></tr><tr><td width="121" height="30" valign="middle"><p align="right" class="style3"><strong>Data do treinamento: </strong> </p></td><td width="9" height="30"> </td><td height="30" colspan="5" valign="middle"><span id='divcombodata'><select name="IDTreinamento" class="combo_inscricoes"><option selected="selected" value="0">Selecione! </option></select></span></td></tr><tr><td width="121" height="30" valign="middle"><p align="right" class="style3"><strong>Nome completo:</strong> </p></td><td width="9" height="30"> </td><td height="30" colspan="5" valign="middle"><table width="311" cellpadding="0" cellspacing="0"><tr><td width="10"><img src="Fireworks/images/box_esq1.jpg" alt="" name="box_esq1" width="10" height="23" border="0" id="box_esq1" /></td><td><label><input name="nome" type="text" class="textfield_redondo_home" style="width:289px" size="1" /></label></td><td width="10"><img src="Fireworks/images/box_dir1.jpg" alt="" name="box_dir1" width="10" height="23" border="0" id="box_dir1" /></td></tr></table></td></tr><tr><td width="121" height="30" valign="middle"><p align="right" class="style3"><strong>Cracha:</strong> </p></td><td width="9" height="30"> </td><td height="30" colspan="3" valign="middle"><table width="160" cellpadding="0" cellspacing="0"><tr><td width="10"><img src="Fireworks/images/box_esq1.jpg" alt="" name="box_esq1" width="10" height="23" border="0" id="box_esq1" /></td><td><label><input name="nome_cracha" type="text" class="textfield_redondo_home" style="width:138px" size="1" /></label></td><td width="10"><img src="Fireworks/images/box_dir1.jpg" alt="" name="box_dir1" width="10" height="23" border="0" id="box_dir1" /></td></tr></table></td><td width="35" height="30" valign="middle"><div align="center"><strong class="style3">Sexo:</strong></div></td><td width="97" height="30" valign="middle"><select name="sexo" class="combo_inscricoes" style="width:91; height:19"><option selected="selected" value="M">Masculino </option><option value="F">Feminino </option></select></td></tr><tr><td width="121" height="30" valign="middle"><p align="right" class="style3"><strong>Amigo que indicou:</strong> </p></td><td width="9" height="30"> </td><td height="30" colspan="5" valign="middle"><table width="311" cellpadding="0" cellspacing="0"><tr><td width="10"><img src="Fireworks/images/box_esq1.jpg" alt="" name="box_esq1" width="10" height="23" border="0" id="box_esq1" /></td><td><label><input name="indicador" type="text" class="textfield_redondo_home" style="width:289px" size="1" /></label></td><td width="10"><img src="Fireworks/images/box_dir1.jpg" alt="" name="box_dir1" width="10" height="23" border="0" id="box_dir1" /></td></tr></table></td></tr><tr><td width="121" height="30" valign="middle"><p align="right" class="style3"><b>CEP</b>:</td><td width="9" height="30"> </td><td height="30" colspan="5" valign="middle"><table width="98" cellpadding="0" cellspacing="0"><tr><td width="10" style="color: #003399"><img src="Fireworks/images/box_esq1.jpg" alt="" name="box_esq2" width="10" height="23" border="0" id="box_esq2" /></td><td style="color: #003399"><label><input name="cep" type="text" class="textfield_redondo_home" style="width:72; height:19" size="1" onchange="trazcep();"/></label></td><td width="13" style="color: #003399"><img src="Fireworks/images/box_dir1.jpg" alt="" name="box_dir2" width="10" height="23" border="0" id="box_dir2" /></td></tr></table></td></tr><tr><td height="30" valign="middle" colspan="7"><p align="center"><font face="Arial" size="1"><span id='divcombocep'> Insira o Cep para carregar o endereço. Se você não sabe o seu CEP <a href="#buscacep">clique aqui</a></span></font></td></tr><tr><td width="121" height="30" valign="middle"><p align="right" class="style3"><strong>Fone res.:</strong> </p></td><td width="9" height="30"> </td><td height="30" valign="middle" width="5"> </td><td height="30" valign="middle" width="121"><table width="110" cellpadding="0" cellspacing="0"><tr><td width="10"><img src="Fireworks/images/box_esq1.jpg" alt="" name="box_esq1" width="10" height="23" border="0" id="box_esq1" /></td><td><label><input name="fone_res" type="text" class="textfield_redondo_home" style="width:88px" onKeyPress="Mascara('telefone', window.event.keyCode, 'document.cadastro.fone_res');" size="1" /></label></td><td width="10"><img src="Fireworks/images/box_dir1.jpg" alt="" name="box_dir1" width="10" height="23" border="0" id="box_dir1" /></td></tr></table></td><td height="30" valign="middle" width="60"><div align="right"><strong class="style3">Fone com. <span class="style6">v</span>:</strong></div></td><td height="30" colspan="2" valign="middle"><table width="110" cellpadding="0" cellspacing="0"><tr><td width="10"><img src="Fireworks/images/box_esq1.jpg" alt="" name="box_esq1" width="10" height="23" border="0" id="box_esq1" /></td><td><label><input name="fone_com" type="text" class="textfield_redondo_home" style="width:88px" onKeyPress="Mascara('telefone', window.event.keyCode, 'document.cadastro.fone_com');" size="2" /></label></td><td width="10"><img src="Fireworks/images/box_dir1.jpg" alt="" name="box_dir1" width="10" height="23" border="0" id="box_dir1" /></td></tr></table></td></tr><tr><td width="121" height="30" valign="middle"><p align="right" class="style3"><strong>E-mail:</strong> </p></td><td width="9" height="30"> </td><td height="30" colspan="5" valign="middle"><table width="311" cellpadding="0" cellspacing="0"><tr><td width="10"><img src="Fireworks/images/box_esq1.jpg" alt="" name="box_esq1" width="10" height="23" border="0" id="box_esq1" /></td><td><label><input name="email" type="text" class="textfield_redondo_home" style="width:289px" size="1" /></label></td><td width="10"><img src="Fireworks/images/box_dir1.jpg" alt="" name="box_dir1" width="10" height="23" border="0" id="box_dir1" /></td></tr></table></td></tr><tr><td width="121" height="30" valign="middle"><p align="right" class="style3"><strong>Profissão:</strong> </p></td><td width="9" height="30"> </td><td height="30" valign="middle" width="5"> </td><td height="30" valign="middle" width="121"><table width="110" cellpadding="0" cellspacing="0"><tr><td width="10"><img src="Fireworks/images/box_esq1.jpg" alt="" name="box_esq1" width="10" height="23" border="0" id="box_esq1" /></td><td><label><input name="profissao" type="text" class="textfield_redondo_home" style="width:88px" size="1" /></label></td><td width="10"><img src="Fireworks/images/box_dir1.jpg" alt="" name="box_dir1" width="10" height="23" border="0" id="box_dir1" /></td></tr></table></td><td height="30" valign="middle" width="60"><div align="right"><strong class="style3">Empresa:<span class="style6">v</span></strong></div></td><td height="30" colspan="2" valign="middle"><table width="110" cellpadding="0" cellspacing="0"><tr><td width="10"><img src="Fireworks/images/box_esq1.jpg" alt="" name="box_esq1" width="10" height="23" border="0" id="box_esq1" /></td><td><label><input name="empresa" type="text" class="textfield_redondo_home" style="width:88px" size="1" /></label></td><td width="10"><img src="Fireworks/images/box_dir1.jpg" alt="" name="box_dir1" width="10" height="23" border="0" id="box_dir1" /></td></tr></table></td></tr><tr><td width="121" height="30" valign="middle"><p align="right" class="style3"><strong>Data nasc.:</strong> </p></td><td width="9" height="30"> </td><td height="30" valign="middle" width="5"> </td><td height="30" valign="middle" width="121"><table width="110" cellpadding="0" cellspacing="0"><tr><td width="10"><img src="Fireworks/images/box_esq1.jpg" alt="" name="box_esq1" width="10" height="23" border="0" id="box_esq1" /></td><td><label><input name="data_nasc" type="text" class="textfield_redondo_home" style="width:88px" onchange="DateFormat(this,event,true);" onKeyUp="DateFormat(this,event,false);" onkeypress="return autoTab(this, 10, event);" size="1"/></label></td><td width="10"><img src="Fireworks/images/box_dir1.jpg" alt="" name="box_dir1" width="10" height="23" border="0" id="box_dir1" /></td></tr></table></td><td height="30" valign="middle" width="60"><div align="right"><strong class="style3">Fumante?<span class="style6">v</span></strong></div></td><td height="30" colspan="2" valign="middle"><table><tr><td><label class="style3"><input type="radio" name="fumante" value="sim" />Sim<input type="radio" name="fumante" value="nao" />Não</label></td></tr></table></td></tr><tr><td height="30" valign="middle"><div align="right"><strong>Observações:</strong></div></td><td width="9" height="30"> </td><td height="30" colspan="5" valign="middle"><table width="110" cellpadding="0" cellspacing="0"><tr><td width="10" style="color: #003399"> </td><td style="color: #003399"><label><textarea rows="4" name="obs" cols="35"></textarea></label></td><td width="4" style="color: #003399"> </td></tr></table></td></tr><tr><td height="30" valign="middle"> </td><td width="9" height="30"> </td><td height="30" colspan="5" valign="middle"><table width="100%" cellpadding="0" cellspacing="0"><tr><td><div align="center"><label><input name="Reset" type="reset" class="botao" value="Limpar" /></label></div></td><td><div align="center"><input name="Reset2" type="submit" class="botao" value="Enviar" /></div></td></tr></table></td></tr><tr><td height="30" valign="middle"> </td><td width="9" height="30"> </td><td height="30" colspan="3" valign="middle"> </td><td height="30" valign="middle"> </td><td height="30" valign="middle"> </td></tr><tr><td height="30" valign="middle"> </td><td width="9" height="30"> </td><td height="30" colspan="3" valign="middle"> </td><td height="30" valign="middle"> </td><td height="30" valign="middle"> </td></tr></table><input type="hidden" name="CPF" value="219.811.268-05"><input type="hidden" name="pegacep" value=""><input type="hidden" name="idtreinamento" value=""></form><p align="justify" class="style3"> </p></td></tr></table></td><td width="28"> </td></tr></table><p> </p></body></html>

Compartilhar este post


Link para o post
Compartilhar em outros sites

Pag pega cep:

 

<head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /><%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%><% 		numCep = request("pegacep")        			Set cep = Server.CreateObject("ADODB.Connection")			cep.Open "DRIVER=MySQL;SERVER=123.123.123.123;UID=cep;PWD=cep;DATABASE=cep;"			sql = "select * from cep where cep="&trim(numCep)			Set consulta_cep = cep.execute(sql)			If Not (consulta_cep Is nothing) Then               If (Not consulta_cep.BOF) And (Not consulta_cep.EOF) Then					strcep = consulta_cep("cep")					strlogradouro = consulta_cep("logradouro")					strtipo_logradouro = consulta_cep("tipo_logradouro")					strbairro = consulta_cep("bairro")					strcidade = consulta_cep("cidade")					strestado = consulta_cep("estado")					strcepemp = consulta_cep("cep")				end if		end if %><% Response.Charset="ISO-8859-1" %>          </head>          <table width="448" cellpadding="0" cellspacing="0">            <tr>              <td width="121" height="30" valign="middle" style="color: #003399"><p align="right" class="style3"><strong>				Endereço:</strong> </p></td>              <td width="9" height="30" style="color: #003399"> </td>              <td height="30" colspan="3" valign="middle" style="color: #003399"><table width="311" cellpadding="0" cellspacing="0">                  <tr>                    <td width="10" style="color: #003399">					<img src="Fireworks/images/box_esq1.jpg" alt="" name="box_esq1" width="10" height="23" border="0" id="box_esq1" /></td>                    <td style="color: #003399"><label>                      <input name="endereco" type="text" class="textfield_redondo_home" style="width:289px" size="1" value="<%=strtipo_logradouro%>   <%=strlogradouro%>" />                    </label></td>                    <td width="10" style="color: #003399">					<img src="Fireworks/images/box_dir1.jpg" alt="" name="box_dir1" width="10" height="23" border="0" id="box_dir1" /></td>                  </tr>              </table></td>            </tr>            <tr>              <td width="121" height="30" valign="middle" style="color: #003399"><p align="right" class="style3"><strong>				Bairro:</strong> </p></td>              <td width="9" height="30" style="color: #003399"> </td>              <td width="116" height="30" valign="middle" style="color: #003399"><table width="110" cellpadding="0" cellspacing="0">                  <tr>                    <td width="10" style="color: #003399">					<img src="Fireworks/images/box_esq1.jpg" alt="" name="box_esq1" width="10" height="23" border="0" id="box_esq1" /></td>                    <td style="color: #003399"><label>                      <input name="bairro" type="text" class="textfield_redondo_home" style="width:88px" size="1" value="<%=strbairro%>" />                    </label></td>                    <td width="10" style="color: #003399">					<img src="Fireworks/images/box_dir1.jpg" alt="" name="box_dir1" width="10" height="23" border="0" id="box_dir1" /></td>                  </tr>              </table></td>              <td width="84" valign="middle" style="color: #003399"><div align="right"><strong class="style3">				Cidade:<span class="style6">v</span></strong></div></td>              <td height="30" valign="middle" style="color: #003399"><table width="110" cellpadding="0" cellspacing="0">                  <tr>                    <td width="10" style="color: #003399">					<img src="Fireworks/images/box_esq1.jpg" alt="" name="box_esq1" width="10" height="23" border="0" id="box_esq1" /></td>                    <td style="color: #003399"><label>                      <input name="cidade" type="text" class="textfield_redondo_home" style="width:88px" size="1" value="<%=strcidade%>" />                    </label></td>                    <td width="10" style="color: #003399">					<img src="Fireworks/images/box_dir1.jpg" alt="" name="box_dir1" width="10" height="23" border="0" id="box_dir1" /></td>                  </tr>              </table></td>            </tr>            <tr>              <td width="121" height="30" valign="middle" style="color: #003399"><p align="right" class="style3"><strong>				UF:</strong> </p></td>              <td width="9" height="30" style="color: #003399"> </td>              <td height="30" valign="middle" style="color: #003399"><font face="Arial">                <select name="uf" class="combo_inscricoes" id="ESTADO_RESIDENCIAL0" size="1">                  <option value=" ">-</option>                  <% if strestado <> "" then%>                  <option value="<%=strestado%>" selected><%=strestado%></option>                  <%end if%>                  <option value="AC">AC</option>                  <option value="AL">AL</option>                  <option value="AM">AM</option>                  <option value="AP">AP</option>                  <option value="BA">BA</option>                  <option value="CE">CE</option>                  <option value="DF">DF</option>                  <option value="ES">ES</option>                  <option value="GO">GO</option>                  <option value="MA">MA</option>                  <option value="MG">MG</option>                  <option value="MS">MS</option>                  <option value="MT">MT</option>                  <option value="PA">PA</option>                  <option value="PB">PB</option>                  <option value="PE">PE</option>                  <option value="PI">PI</option>                  <option value="PR">PR</option>                  <option value="RJ">RJ</option>                  <option value="RN">RN</option>                  <option value="RO">RO</option>                  <option value="RR">RR</option>                  <option value="RS">RS</option>                  <option value="SC">SC</option>                  <option value="SE">SE</option>                  <option value="SP">SP</option>                  <option value="TO">TO</option>                </select>              </font></td>              <td width="84" valign="middle" style="color: #003399"><div align="right">				<strong>N°</strong><strong class="style3">:<span class="style6">v</span></strong></div></td>              <td height="30" valign="middle" style="color: #003399"><table width="110" cellpadding="0" cellspacing="0">                  <tr>                    <td width="10" style="color: #003399">					<img src="Fireworks/images/box_esq1.jpg" alt="" name="box_esq1" width="10" height="23" border="0" id="box_esq1" /></td>                    <td style="color: #003399"><label>                      <input name="numero" type="text" class="textfield_redondo_home" style="width:88px" size="1" />                    </label></td>                    <td width="10" style="color: #003399">					<img src="Fireworks/images/box_dir1.jpg" alt="" name="box_dir1" width="10" height="23" border="0" id="box_dir1" /></td>                  </tr>              </table></td>            </tr>          </table>pega datas:<% Response.Charset="ISO-8859-1" %><p>					<select class="combo_inscricoes" id="data" name="data"  size="1">			 	<option value="0">Selecione!</option>                <%                                id = request.querystring("idtreinamento")sqlstmt = "Select * From treinamentos where tipo_treinamento like '%" & id & "%' order by data asc"Set rs = Server.CreateObject("ADODB.Recordset")  rs.Open sqlstmt, connDo While NOT rs.EOF%>                            <option value="<%Response.Write(rs("cod_treinamento"))%>" <%=selected%>><%=day(Rs("Data"))&"/"&month(Rs("data"))&"/"&year(Rs("data"))%></option>                <%							   rs.MoveNext        Loop        rs.Close							%>grava no banco:<%novadata = month(Request.Form("Data_nasc"))&"/"&day(Request.Form("data_nasc"))&"/"&year(Request.Form("data_nasc"))treinamento = request.form("data")nome = request.form("nome")endereco = request.form("endereco")numero = request.form("numero")complemento = request.form("complemento")bairro = request.form("bairro")cidade = request.form("cidade")uf = request.form("uf")cep = request.form("cep")fone_res = request.form("fone_res")fone_com = request.form("fone_com")sexo = request.form("sexo")nome_cracha = request.form("nome_cracha")profissao = request.form("profissao")empresa = request.form("empresa")data_nasc = request.form("data_nasc")fumante = request.form("fumante")observacao = request.form("observacao")email = request.form("email")strSQL = "INSERT INTO inscricao(treinamento,nome,endereco,numero,complemento,bairro,cidade,uf,cep,fone_res,fone_com,sexo,nome_cracha,profissao,empresa,data_nasc,fumante,observacao, email) VALUES('" & treinamento & "','" & nome & "','" & endereco & "','" & numero & "','" & complemento & "','" & bairro & "','" & cidade & "','" & uf & "','" & cep & "','" & fone_res & "','" & fone_com & "','" & sexo & "','" & nome_cracha & "','" & profissao & "','" & empresa & "','" & data_nasc & "','" & fumante & "','" & observacao & "','" & email & "')"Call Conn.Execute(strSQL)%><% NOME = REQUEST.FORM("NOME")EMAIL = REQUEST.FORM("EMAIL")TELEFONE = request.form("telefone")mensagem = request.form("mensagem")strBody = " <HTML>"strBody = strBody & "<HEAD>"strBody = strBody & "<TITLE>CentralBank</TITLE>"strBody = strBody & "<META HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=windows-1251'>"strBody = strBody & "<style type='text/css'>"strBody = strBody & "<!--"strBody = strBody & "td {"strBody = strBody & "	text-align: left;"strBody = strBody & "	vertical-align: top;"strBody = strBody & "	font-family:Tahoma;"strBody = strBody & "	font-size:11px;"strBody = strBody & "	color:#727272;"strBody = strBody & "}"strBody = strBody & "a {"strBody = strBody & "	text-decoration: underline;"strBody = strBody & "	color:#64878E;"strBody = strBody & "}"strBody = strBody & "a.1 {"strBody = strBody & "	text-decoration: none;"strBody = strBody & "	color: 000000;"strBody = strBody & "}"strBody = strBody & ".t11 {"strBody = strBody & "	font-family: Tahoma;"strBody = strBody & "	font-size: 11px;"strBody = strBody & "	font-style: normal;"strBody = strBody & "}"strBody = strBody & "body  {margin:0px;padding:0px}"strBody = strBody & "-->"strBody = strBody & "</style>"strBody = strBody & ""strBody = strBody & "</HEAD>"strBody = strBody & "<BODY BGCOLOR=#FFFFFF LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0>"strBody = strBody & "<!-- ImageReady Slices (1_home.psd - Slices: 02, 03, 04, bottom, flash) -->"strBody = strBody & "<TABLE WIDTH=766 BORDER=0 CELLPADDING=0 CELLSPACING=0 align='center'>"strBody = strBody & "	<TR>"strBody = strBody & "		<TD WIDTH=766 HEIGHT=32 ALT='' valign='top' background='http://www.centralbank.com.br/images/bg1.jpg'>"strBody = strBody & "		<table width='766' height='32' border='0' cellspacing='0' cellpadding='0'>"strBody = strBody & "  <tr>"strBody = strBody & "    <td width='10' valign='top'><img src='http://www.centralbank.com.br/images/spacer.gif'></td>"strBody = strBody & "    <td width='264' valign='top'>"strBody = strBody & "	<div style='margin-left:17px; margin-top:14px; font-size:12px; color:#BD4C04 '>"strBody = strBody & "		<strong>Mensagem de Contato</strong></div>"strBody = strBody & "	</td>"strBody = strBody & "    <td width='241' valign='top'>"strBody = strBody & "	 </td>"strBody = strBody & "    <td width='251' valign='top'>"strBody = strBody & "	 </td>"strBody = strBody & "  </tr>"strBody = strBody & "</table>"strBody = strBody & ""strBody = strBody & "		</TD>"strBody = strBody & "	</TR>"strBody = strBody & "	<TR>"strBody = strBody & "		<TD WIDTH=766 HEIGHT=146 ALT='' valign='top'>"strBody = strBody & "		<TABLE WIDTH=766 BORDER=0 CELLPADDING=0 CELLSPACING=0>"strBody = strBody & "	<TR>"strBody = strBody & "		<TD background='http://www.centralbank.com.br/images/dot.jpg' style='background-position:right top; background-repeat:repeat-y '>"strBody = strBody & "			<IMG SRC='http://www.centralbank.com.br/images/spacer.gif' WIDTH=9 HEIGHT=291 ALT=''></TD>"strBody = strBody & "		<TD WIDTH=747 HEIGHT=146 ALT='' valign='top' background='http://www.centralbank.com.br/images/dot.jpg' style='background-position:right top; background-repeat:repeat-y '>"strBody = strBody & "		 <p>Nome do Cliente: "&nome&"</p>"strBody = strBody & "		<p>Email do Cliente: "&email&"</p>"strBody = strBody & "		<p>Telefone: "&telefone&"</p>"strBody = strBody & "		<p>Mensagem: "&mensagem&"</p>"strBody = strBody & "		<p> </TD>"strBody = strBody & "		<TD background='http://www.centralbank.com.br/images/dot.jpg' style='background-position:left top; background-repeat:repeat-y '>"strBody = strBody & "			<IMG SRC='http://www.centralbank.com.br/images/spacer.gif' WIDTH=10 HEIGHT=146 ALT=''></TD>"strBody = strBody & "	</TR>"strBody = strBody & "</TABLE>"strBody = strBody & "		</TD>"strBody = strBody & "	</TR>"strBody = strBody & "	<TR>"strBody = strBody & "		<TD background='http://www.centralbank.com.br/images/bottom.jpg' WIDTH=766 HEIGHT=60 ALT='' valign='top'>"strBody = strBody & "		 </TD>"strBody = strBody & "	</TR>"strBody = strBody & "</TABLE>"strBody = strBody & "<!-- End ImageReady Slices -->"strBody = strBody & "</BODY>"strBody = strBody & "</HTML>"cliente = emaildemail = "sac@centralbank.com.br"RESPONDER = EMAILSet Mail = Server.CreateObject("Persits.MailSender")Mail.Host = "mail-nt.braslink.com"Mail.From = demailMail.FromName = "CentralBank"destinatario = demailMail.AddAddress destinatariomail.Addcc  respondermail.AddReplyTo responder'Descomente a linha abaixo para enviar e-mail em formato HTMLMail.IsHTML = TrueMail.Subject = "Mensagem de Contato - Data "& day(date)&"/"& month(date)&"/"& year(date)&" "Mail.Body = strbodyerro = ""sucesso = FalseOn Error Resume Next 'Verifica errosMail.Send 'Envia mensagemIf Err <> 0 Thenerro = Err.Descriptionelsesucesso = TrueEnd IfSet Mail = nothing%><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /><title>Untitled Document</title><style type="text/css"><!--.style1 {font-family: Arial, Helvetica, sans-serif}body,td,th {	color: #003399;}a:link {	color: #003399;}a:visited {	color: #003399;}a:hover {	color: #003399;}a:active {	color: #003399;}.style5 {	font-family: Arial, Helvetica, sans-serif;	font-size: 12px;	font-weight: bold;	font-style: italic;}--></style><link href="pd_styles.css" rel="stylesheet" type="text/css" /><style type="text/css"><!--.style6 {color: #FFFFFF}.style7 {color: #003399}.style8 {	font-size: 24px;	font-weight: bold;}.style9 {font-size: 16px}--></style><script type="text/JavaScript"><!--function MM_goToURL() { //v3.0  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");}//--></script></head><body><table width="508" cellpadding="0" cellspacing="0">  <tr>    <td width="30"> </td>    <td><table border="0" cellspacing="0" cellpadding="0" width="100%">      <tr>        <td valign="top"><table border="0" cellspacing="0" cellpadding="0" width="100%">            <tr>              <td valign="top" class="style1"><p> </p></td>              <td valign="top" class="style1"> </td>              <td valign="top" ><div align="right" class="style5"><a href="FAQ_LEI.asp"></a></div></td>            </tr>            <tr>              <td valign="top" bgcolor="#CCCCFF" class="style1"><p><strong>Inscrição Confirmada</strong> </p></td>              <td valign="top" bgcolor="#CCCCFF" class="style1"> </td>              <td valign="top" bgcolor="#CCCCFF" > </td>            </tr>            <tr>              <td valign="top" bgcolor="#FFFFFF" class="style1 style6"> </td>              <td rowspan="2" valign="top" bgcolor="#FFFFFF" class="style1 style6"> </td>              <td rowspan="2" valign="top" bgcolor="#FFFFFF" ><span class="style6"></span></td>            </tr>            <tr>              <td valign="top" bgcolor="#FFFFFF" class="style1 style7"><div align="center" class="style8">                <p>Parabéns!!!!</p>                <p class="style9">Sua Inscrição concluida com sucesso, você receberá no e-mail cadastrado a confirmação deste cadastro e todas as informaçãoes necessárias para que tenha u excelente treinamento.</p>                <p class="style9">                  <input name="Reset2" type="button" class="botao" onclick="MM_goToURL('parent','default.asp');return document.MM_returnValue" value="HOME"/>                </p>              </div></td>            </tr>        </table></td>      </tr>      <tr>        <td>          </td>      </tr>    </table></td>    <td width="28"> </td>  </tr></table><p> </p></body></html>

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.