boat73 has asked for the wisdom of the Perl Monks concerning the following question:
<html> <head> <meta http-equiv="Content-Language" content="en-us"> <meta http-equiv="Content-Type" content="text/html; charset=windows-12 +52"> <title>Name</title> </head> <body> <form name=form method="POST" action="http://localhost/vfsscripts/junk +.cgi"> <blockquote> <blockquote> <blockquote> <p> &nb +sp; Name <input type="text" name="Name" size="20"></ +p> <blockquote> <blockquote> <p>Email <input type="text" name="Email" size="20"></p> <p><font face="Verdana" size="1"> <input type="submit" value="Submit" tabindex="37"></font></p> <p> </p> </blockquote> </blockquote> </blockquote> </blockquote> </blockquote> </form> </body> </html>
#!c:/Perl/bin/Perl.exe use CGI; print "Content-type: text/html\n\n"; $query = new CGI; &testform(); sub testform{ $Name = $query->param("Name"); $Email = $query->param("Email"); if(($Name !~ /\w/) || ($Email !~ /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0 +-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/)){ #### SEND BACK TO HTML FOR AND FILL IN WITH DATA ALREADY ENTER +ED #### } else { print "Name => $Name<br>"; print "Email => $Email<br>"; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: have cgi send data back to form on error
by chb (Deacon) on Feb 11, 2005 at 07:15 UTC | |
by Nevtlathiel (Friar) on Feb 11, 2005 at 14:06 UTC | |
|
Re: have cgi send data back to form on error
by Errto (Vicar) on Feb 11, 2005 at 04:14 UTC | |
by boat73 (Scribe) on Feb 11, 2005 at 04:43 UTC | |
by Errto (Vicar) on Feb 11, 2005 at 13:41 UTC | |
|
Re: have cgi send data back to form on error
by TedPride (Priest) on Feb 11, 2005 at 06:35 UTC | |
|
Re: have cgi send data back to form on error
by Popcorn Dave (Abbot) on Feb 11, 2005 at 17:37 UTC |