<form action="newsletter_enviar.asp" method="post" name="newsletter" onsubmit="return EnviarNewsletter();" >
<table width="157" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="400%" height="27" colspan="2"><table width="100%" height="42" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="71%" height="33">Email:
<input name="email" type="text" class="form" id="email" size="15" />
<input type="submit" name="Submit" value="ok" /></td>
</tr>
</table></td>
</tr>
<tr>
<td height="22" colspan="2">
<input name="opcao" type="radio" value="a" checked="checked" />
assinar
<input name="opcao" type="radio" value="c" />
cancelar</td>
</tr>
</table>
</form><%
' AQUI CONEXÂO COM O BANCO DE DADOS
' MySql
Set conn = Server.CreateObject("ADODB.Connection")
conn.ConnectionString = "DRIVER={MySQL ODBC 3.51 Driver};"_
& "SERVER=servidor;"_
& " DATABASE=nomedatabase;"_
& "UID=usuario;PWD=senha;OPTION=3"
conn.CursorLocation = 3
conn.Open
'recebe os valores da NEWSLETTER.ASP
opcao=request("opcao")
email=request("email")
if opcao = "a" then
sql="INSERT INTO newsletter(email) VALUES ('" & email & "')"
else if opcao = "c" then
sql="DELETE FROM newsletter WHERE email = '" & email & "'"
end if
Set GRAVA = Server.CreateObject("ADODB.Recordset")
GRAVA.Open sql, conn
Set GRAVA = Nothing
conn.Close
response.wite "OK"
%>
![]() |
CodigoFonte.net » CodigoFonte.eti.br » Procurando o que comprar? » MeuMural.com.br » Todos os Direitos Reservados © 2002/2008 |
Procurando Notebooks, Câmeras Digitais, iPhones?