Avatar billede pizzamania Nybegynder
08. juli 2001 - 00:48 Der er 12 kommentarer og
1 løsning

Email list sign up form !

Hi everyone I sure hope some can help me with this problem....

I got a email list database, called subs.mdb and in there I got a table called \"emails\". I want someone out there to help me make a form like the one on , Ontheminute.com where people can sign up and unsubscribe. But they dont change web sites when they for example write in a email allready subscribing to the list, they just get for example a little message under it , like \"You allready subscribe to the newsletter\"...

is that possible to dp ?  can you make it ?  do you know of scripts that can do that allready ?
Avatar billede okay Nybegynder
08. juli 2001 - 00:51 #1
Avatar billede pizzamania Nybegynder
08. juli 2001 - 00:55 #2
thats the newsletter I use but I have experienced some problems with the mailing list.. For example thoose new windows that Ontheminute.com also get.. or they change site...  do you understand ?
Avatar billede okay Nybegynder
08. juli 2001 - 00:58 #3
Send me the database Jamal@web-zone.dk
Avatar billede ellebaek Nybegynder
08. juli 2001 - 13:49 #4
<%
str = \"DRIVER={Microsoft Access Driver (*.mdb)};DBQ=\" & Server.MapPath(\"subs.mdb\")

set rs = server.createobject(\"ADODB.Connection\")
subscribe = request.form(\"subs\")
unsubs = request.form(\"unsubs\")
if send <> \"\" Then
email = request.form(\"email\")
sql = \"Select * from emails where email LIKE \'\"&email&\"\'\"
rs.open sql,str
if rs.EOF then
sql2 = \"Insert into emails(email) Values(\'\"&email&\"\')\"
set rs = rs.execute(sql2)
Alert = \"You are now subscribed to the newsletter\"
rs.close
else
Alert = \"You are already subscribed to the newsletter\"
end if

Elseif unsubs <> \"\" Then
email = request.form(\"email\")
sql = \"Select * from Emails where email LIKE \'\"&email&\"\'\"
rs.open sql,str
if rs.eof then
Alert = \"You are not subscribed to the newsletter\"
else
sql2 = \"DELETE from emails where email = \'\"&email&\"\'\"
set rs = rs.execute(sql2)
Alert = \"You have been unsubscribed\"
end if
End if
<html>
<head>
<title>Newsletter</title>
</head>
<body>
<center>
<b><%=Alert%></b>
<form method=\"post\" action=\"news.asp\">
<b>Your email:<br></b>
<input type=\"text\" name=\"email\"><br><br>
<input type=\"submit\" name=\"subs\" value=\"subscribe\">
<input type=\"submit\" name=\"unsubs\" value=\"unsubscribe\">
</form>
</body>
</html>
Avatar billede ellebaek Nybegynder
08. juli 2001 - 13:50 #5
woups ...
a little bug ...
before the start of the <html> you need a line with
%>
Avatar billede pizzamania Nybegynder
08. juli 2001 - 17:27 #6
Hey,

it doesnt work:
http://www.ontheminute.com/newsletter.asp

Did you et my email \"okay\" ?
Avatar billede ellebaek Nybegynder
09. juli 2001 - 19:53 #7
you need to name the asp document news.asp

Or you can change the line <form method=\"post\" action=\"news.asp\">

to: <form method=\"post\" action=\"newsletter.asp\">
that might work!
Avatar billede pizzamania Nybegynder
09. juli 2001 - 20:15 #8
I changed that line to newsletter.asp. And it still doesnt work.


<%
str = \"DRIVER={Microsoft Access Driver (*.mdb)};DBQ=\" & Server.MapPath(\"news/admin/mailinglist/db/subs.mdb\")

set rs = server.createobject(\"ADODB.Connection\")
subscribe = request.form(\"subs\")
unsubs = request.form(\"unsubs\")
if send <> \"\" Then
email = request.form(\"email\")
sql = \"Select * from emails where email LIKE \'\"&email&\"\'\"
rs.open sql,str
if rs.EOF then
sql2 = \"Insert into emails(email) Values(\'\"&email&\"\')\"
set rs = rs.execute(sql2)
Alert = \"You are now subscribed to the newsletter\"
rs.close
else
Alert = \"You are already subscribed to the newsletter\"
end if

Elseif unsubs <> \"\" Then
email = request.form(\"email\")
sql = \"Select * from Emails where email LIKE \'\"&email&\"\'\"
rs.open sql,str
if rs.eof then
Alert = \"You are not subscribed to the newsletter\"
else
sql2 = \"DELETE from emails where email = \'\"&email&\"\'\"
set rs = rs.execute(sql2)
Alert = \"You have been unsubscribed\"
end if
End if
%>

<html>
<head>
<title>Newsletter</title>
</head>
<body>
<center>
<b><%=Alert%></b>
<form method=\"post\" action=\"newsletter.asp\">
<b>Your email:<br></b>
<input type=\"text\" name=\"email\"><br><br>
<input type=\"submit\" name=\"subs\" value=\"subscribe\">
<input type=\"submit\" name=\"unsubs\" value=\"unsubscribe\">
</form>
</body>
</html>


Avatar billede okay Nybegynder
09. juli 2001 - 23:59 #9
it emails and not email I think !!

I dont have access2000 to view the database...
Avatar billede pizzamania Nybegynder
10. juli 2001 - 00:29 #10
Test it yourself, and you will probably see the errors:_
http://www.ontheminute.com/newsletter.asp
Avatar billede ellebaek Nybegynder
12. juli 2001 - 14:27 #11
Change the entire scriptsource with this scource ...

That might work, the problem is the input area, it has not got the name it should have...

so try this:
<%
str = \"DRIVER={Microsoft Access Driver (*.mdb)};DBQ=\" & Server.MapPath(\"news/admin/mailinglist/db/subs.mdb\")

set rs = server.createobject(\"ADODB.Connection\")
subscribe = request.form(\"subs\")
unsubs = request.form(\"unsubs\")
if send <> \"\" Then
email = request.form(\"email\")
sql = \"Select * from emails where email LIKE \'\"&email&\"\'\"
rs.open sql,str
if rs.EOF then
sql2 = \"Insert into emails(email) Values(\'\"&email&\"\')\"
set rs = rs.execute(sql2)
Alert = \"You are now subscribed to the newsletter\"
rs.close
else
Alert = \"You are already subscribed to the newsletter\"
end if

Elseif unsubs <> \"\" Then
email = request.form(\"email\")
sql = \"Select * from Emails where email LIKE \'\"&email&\"\'\"
rs.open sql,str
if rs.eof then
Alert = \"You are not subscribed to the newsletter\"
else
sql2 = \"DELETE from emails where email = \'\"&email&\"\'\"
set rs = rs.execute(sql2)
Alert = \"You have been unsubscribed\"
end if
End if
%>

<html>
<head>
<title>Newsletter</title>
</head>
<body>
<center>
<b><%=Alert%></b>
<form method=\"post\" action=\"newsletter.asp\">
<b>Your email:<br></b>
<input type=\"text\" name=\"email\"><br><br>
<input type=\"submit\" name=\"subs\" value=\"subscribe\">
<input type=\"submit\" name=\"unsubs\" value=\"unsubscribe\">
</form>
</body>
</html>
Avatar billede pizzamania Nybegynder
26. august 2001 - 01:26 #12
It did not work.........
Avatar billede pizzamania Nybegynder
26. august 2001 - 01:26 #13
  It did not work......... 
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Kurser inden for grundlæggende programmering

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester



IT-JOB

Capgemini Danmark A/S

SAP Accelerate Program

Politiets Efterretningstjeneste

Sektionsledere til Center for infrastruktur i PET

Danoffice IT

Senior AI Specialist

Center Denmark Fonden

Cloud Engineer