Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl require "cgi-lib.pl"; &ReadParse; $email = $in{'visitor_email_address'}; $password = $in{'visitor_password'}; print &PrintHeader; if ($email eq "" && $password eq "") { print <<"PrintTag"; <html> <head> <title>The Soccer Message Board!</title> <title>The </title> <title>The Soccer </title> <title>The Soccer Message </title> <title>The Soccer Message Board!</title> <meta name="description" CONTENT="This is the site where soccer player +s can find coaches and coaches can find players. Also be updated abo +ut tournaments and other special events."> <LINK REL=stylesheet TYPE="text/css" HREF="soccer.css"> </head> <body bgcolor="#18D018" TEXT="black"> <br> <p align="center"><marquee behavior=alternate direction=left loop=infi +nite bgcolor=#18D018 width=85% align=right><h1>Welcome to the Soccer +Message Board!</marquee></p> <h2 align="center"><font color="#C91f16">Error!</h2> <h4 align="center">You forgot to fill in one or more of the fields bel +ow. Please try again.</font></h4> <blockquote><blockquote><font size="+1">The Soccer Message Board was s +tarted to help soccer players to find coaches and for coaches to find + players. At the home page, you can conduct a message search, or pos +t a message. You will also find this site extremely simple to naviga +te and use. If you have any questions or comments, please </font><a +href="mailto:sonsofthunder4\@juno.com">email us</a><font size="+1">, +so we can help make your visit to The Soccer Message Board more enjoy +able!</blockquote></blockquote> <blockquote><blockquote><font size="+2" color="#C91f16"><b><u>IMPORTAN +T</u> :</b></FONT> <FONT SIZE="+1">If you are a first time user, you +must input your email address in the text box below. Your email addr +ess can be any combination of letters and numbers 50 characters or le +ss. Do not use your name! Your email address will be needed to cont +inue through this site. If anyone posts a vulgar, degrading, or inap +propriate message, the email addresses will be used to punish any per +petrators.</FONT><B> THIS SITE WILL NOT RUN IF YOU DO NOT ACCEPT THE + COOKIE THAT REMEMBERS YOUR EMAIL ADDRESS.</B></blockquote></blockquo +te><br> <form action="http://soccermb.netfirms.com/cgi-bin/index1.cgi" method= +"post"> <p align="center"><table CELLSPACING="5"><TR><TD><font size="+1">Your +Email Address : <input type="text" name="visitor_email_address" value +="$email" size="20" maxlength="50"></TD><td></td></font></TD></TR><TR +><TD><font size="+1">Your Password : <input type="text" name="visitor +_password" value="$password" size="18" maxlength="20"> <input type="s +ubmit" value="Enter"></font></TD></TR> </TABLE></p> </form> <blockquote><blockquote><p align="center"><font size="+1">First time v +isitor? Just </font><a href="new.htm">click here</a><font size="+1"> +.</font></p></blockquote></blockquote> <br> <blockquote><blockquote><font size="+1">NOTE : If you do not have an e +mail address, you may create one at Yahoo! for free. Just </font><a +href="http://mail.yahoo.com/">click here!</a></blockquote></blockquot +e><br> </body> </html> PrintTag exit; } if ($email !~ /.+\@.+\..+/) { print <<"PrintTag"; <html><head><title>Error!</title> <LINK REL=stylesheet TYPE=\"text/css\" HREF=\"soccer.css\"> </head><body bgcolor="#18D018" TEXT="black"> <h1 align=\"center\"><font color=\"#C91f16\">Error!</font></h1> <blockquote><blockquote><blockquote><p align=\"center\"> Please enter your email address in this format:<br><br> email\@address.com <br><br> Please <a href=\"index.htm\">try again</a>. </blockquote></blockquote></blockquote></p> </body></html> PrintTag exit; } if (-e "lock.fil") { print <<"PrintTag"; <HTML> <HEAD> <TITLE>File in use</TITLE> </HEAD> <BODY BGCOLOR="#18D018" TEXT="black"> <H1>Please try again!</H1> <BLOCKQUOTE> The database is in use. Please try again later. </BLOCKQUOTE> </BODY> </HTML> PrintTag exit; } else { open(LOCK_FILE, ">lock.fil"); open(FILE,">>data.txt") || die "Can't find database\n"; print FILE "$email|$password\n"; close(FILE); close(LOCK_FILE); unlink("lock.fil"); print <<"PrintTag"; <html><head><title>Welcome!</title> <LINK REL=stylesheet TYPE="text/css" HREF="soccer.css"> </head><body bgcolor="#18D018" text="black"> <h2 align="center">Welcome!</h2> <blockquote><blockquote><blockquote> <p align="center"><font size="+1">(Please write this down)<br> <br>Your email address is $email, and your password is $password<br> Please enter <a href="home.htm">here</a>.<br></font></p> </blockquote></blockquote></blockquote></body></html> PrintTag }
2006-10-20 Retitled by planetscape, as per Monastery guidelines: one-word (or module-only) titles hinder site navigation
Original title: 'Newbie'
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Newbie needs help with email CGI script
by kilinrax (Deacon) on Oct 30, 2000 at 20:31 UTC | |
|
(Ovid) Re: Newbie needs help with email CGI script
by Ovid (Cardinal) on Oct 30, 2000 at 21:35 UTC |