<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://www.webmaster-forums.net/crss/node/1015880" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title></title>
    <link>https://www.webmaster-forums.net/crss/node/1015880</link>
    <description></description>
    <language>en</language>
          <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/validate-email-using-perl#comment-1092161</link>
    <description> &lt;p&gt;Not letting them submit is done with Javascript...&lt;br /&gt;
I&#039;ve seen this used many times before and I&#039;ve been looking for it for a little while now...&lt;br /&gt;
What type of file is the form-submitting page? Perl or HTML?&lt;br /&gt;
Can you give me a link, or PM or email it?&lt;br /&gt;
Thanks&lt;/p&gt;
 </description>
     <pubDate>Mon, 22 Oct 2001 23:09:40 +0000</pubDate>
 <dc:creator>nike_guy_man</dc:creator>
 <guid isPermaLink="false">comment 1092161 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/validate-email-using-perl#comment-1092160</link>
    <description> &lt;p&gt;I want the info to stay in the form AND go back. I tried it with the JS, and no info was lost.&lt;/p&gt;
&lt;p&gt;This idea: &lt;/p&gt;
&lt;p&gt;&quot;You could also set up an alert on the form page that will not let them POST to the .cgi unless the form fields are valid.&quot; &lt;/p&gt;
&lt;p&gt;sounds the best so far. That would make it even easier. But can that be done with perl?&lt;/p&gt;
 </description>
     <pubDate>Mon, 22 Oct 2001 23:07:35 +0000</pubDate>
 <dc:creator>rline</dc:creator>
 <guid isPermaLink="false">comment 1092160 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/validate-email-using-perl#comment-1092159</link>
    <description> &lt;p&gt;I&#039;m a bit confused...&lt;br /&gt;
Do you want the info to stay in the form or just go back?&lt;br /&gt;
sometimes going back loses some info.&lt;br /&gt;
With PERL you can save all the info.&lt;br /&gt;
You could also set up an alert on the form page that will not let them POST to the .cgi unless the form fields are valid.&lt;br /&gt;
I&#039;m still looking for this script though.&lt;/p&gt;
 </description>
     <pubDate>Mon, 22 Oct 2001 22:58:32 +0000</pubDate>
 <dc:creator>nike_guy_man</dc:creator>
 <guid isPermaLink="false">comment 1092159 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/validate-email-using-perl#comment-1092158</link>
    <description> &lt;p&gt;Actually, since my last post, I figured out how to do it with JS, in case you&#039;re interested. I&#039;d still prefer with perl, because not everyone will have JS turned on, but until you can come up with something, and in case you care(!), here it is:&lt;/p&gt;
&lt;p&gt;if (email is a valid one) {&lt;br /&gt;
   do the normal stuff...&lt;br /&gt;
}&lt;/p&gt;
&lt;p&gt;else {&lt;br /&gt;
$error = &quot;The email address you entered, $FORM{&#039;email&#039;}, is invalid. You will now be taken back to enter your email address. Thankyou.&quot;;&lt;/p&gt;
&lt;p&gt;print &quot;Content-type:text/html\n\n&quot;;&lt;/p&gt;
&lt;p&gt;                print &quot;&amp;lt;script language=\&quot;javascript\&quot;&amp;gt;alert(\&quot;$error\&quot;)\;\n&quot;;&lt;br /&gt;
		print &quot;window.location=\&quot;javascript:history.back()\&quot;\;&amp;lt;/script&amp;gt;&quot;;&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;...It throws up an alert box, and when they click OK, it goes back to the form. Pretty neat, but I still think perl will be better...I wait in anticiapation!&lt;/p&gt;
 </description>
     <pubDate>Mon, 22 Oct 2001 22:49:48 +0000</pubDate>
 <dc:creator>rline</dc:creator>
 <guid isPermaLink="false">comment 1092158 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/validate-email-using-perl#comment-1092157</link>
    <description> &lt;p&gt;I&#039;ve done the same, many a time... gotten help, think it&#039;ll work, thank and praise them, only to find it won&#039;t work and you have to go back &lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/smile.png&quot; title=&quot;Smiling&quot; alt=&quot;Smiling&quot; class=&quot;smiley-content&quot; /&gt;&lt;br /&gt;
I&#039;m not sure about writing it in JS, but I&#039;ll try with PERL.&lt;br /&gt;
I&#039;ll post what I can find later...&lt;br /&gt;
Did the second code I wrote for you contain the info from the past page?&lt;br /&gt;
If it does, you could simply have the script write back to itself and if it doesn&#039;t match, it will only show the error page and have the same info filled out, but if its correct, it&#039;ll send the user on.&lt;br /&gt;
For example, name the script &lt;strong&gt;formmail.cgi&lt;/strong&gt; and have the form part of the script point to formmail.cgi also... it works with PHP i&#039;ve done that before.&lt;br /&gt;
I&#039;ll mess around with this for a little while and see what I can come up with!&lt;br /&gt;
Good luck&lt;/p&gt;
 </description>
     <pubDate>Mon, 22 Oct 2001 22:37:16 +0000</pubDate>
 <dc:creator>nike_guy_man</dc:creator>
 <guid isPermaLink="false">comment 1092157 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/validate-email-using-perl#comment-1092130</link>
    <description> &lt;p&gt;Yeah. I tested it before I wrote you back. I&#039;ve learned from the past, when I would thank profusely the person who provided a solution, only to discover that it didn&#039;t work, or on reflection, I didn&#039;t have a clue what it meant!&lt;/p&gt;
&lt;p&gt;So, yes, what you wrote works great. Perhaps there&#039;s only one more thing I could ask you: instead of taking them to a page which asks them to use the back button, how do I write code (perhaps using javascript) so that they get an alert box with the &quot;bad email&quot; message, and then when they click OK, they automatically get taken back to the form they just filled out?&lt;/p&gt;
 </description>
     <pubDate>Mon, 22 Oct 2001 20:29:46 +0000</pubDate>
 <dc:creator>rline</dc:creator>
 <guid isPermaLink="false">comment 1092130 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/validate-email-using-perl#comment-1092124</link>
    <description> &lt;p&gt;No problem&lt;br /&gt;
Did you test it a few times??&lt;br /&gt;
Let me know how it all goes and if all works fine with what you want.&lt;br /&gt;
Thanks&lt;/p&gt;
 </description>
     <pubDate>Mon, 22 Oct 2001 19:50:37 +0000</pubDate>
 <dc:creator>nike_guy_man</dc:creator>
 <guid isPermaLink="false">comment 1092124 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/validate-email-using-perl#comment-1092052</link>
    <description> &lt;p&gt;Hey,&lt;/p&gt;
&lt;p&gt;Thanks a lot Nike_guy_man!&lt;/p&gt;
 </description>
     <pubDate>Mon, 22 Oct 2001 07:28:28 +0000</pubDate>
 <dc:creator>rline</dc:creator>
 <guid isPermaLink="false">comment 1092052 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/validate-email-using-perl#comment-1092022</link>
    <description> &lt;p&gt;Hello&lt;br /&gt;
Here&#039;s how to send them back a page if its not correct syntax:&lt;br /&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;if ($FORM{&amp;#039;email&amp;#039;}) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; unless ($FORM{&amp;#039;email&amp;#039;} =~ /\w+@\w+.\w+/) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print &amp;quot;Content-type: text/html\n\n&amp;quot;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print &amp;quot;&amp;lt;html&amp;gt;&amp;lt;head&amp;gt;&amp;lt;title&amp;gt;Bad E-mail&amp;lt;/title&amp;gt;&amp;lt;/head&amp;gt;\n&amp;quot;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print &amp;quot;&amp;lt;body&amp;gt;&amp;lt;h1&amp;gt;Bad E-mail&amp;lt;/h1&amp;gt;&amp;lt;br&amp;gt;The e-mail address that you&amp;#039;ve\n&amp;quot;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print &amp;quot;entered, $FORM{&amp;#039;email&amp;#039;}, is invalid.&amp;nbsp; Please click back and\n&amp;quot;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print &amp;quot;try again.\n&amp;quot;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; exit;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;}&lt;/code&gt;&lt;/div&gt;&#039;&lt;br /&gt;
To keep them at the page, you could also do&lt;br /&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;if ($FORM{&amp;#039;email&amp;#039;}) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; unless ($FORM{&amp;#039;email&amp;#039;} =~ /\w+@\w+.\w+/) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print &amp;quot;Content-type: text/html\n\n&amp;quot;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print &amp;quot;&amp;lt;html&amp;gt;&amp;lt;head&amp;gt;&amp;lt;title&amp;gt;Bad E-mail&amp;lt;/title&amp;gt;&amp;lt;/head&amp;gt;\n&amp;quot;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print &amp;quot;&amp;lt;body&amp;gt;&amp;lt;h1&amp;gt;Bad E-mail&amp;lt;/h1&amp;gt;&amp;lt;br&amp;gt;The e-mdail address that you&amp;#039;ve\n&amp;quot;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print &amp;quot;entered, $FORM{&amp;#039;email&amp;#039;}, is invalid.&amp;nbsp; Please try again\n&amp;quot;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print &amp;quot;&amp;lt;form method=&amp;#039;POST&amp;#039; action=&amp;#039;form.cgi&amp;#039;&amp;gt; \n&amp;quot;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print &amp;quot;email: &amp;lt;input type=text name=email&amp;gt; \n&amp;quot;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print &amp;quot;&amp;lt;input type=text name=otherinfo value=&amp;#039;$FORM{&amp;#039;otherinfo&amp;#039;}&amp;#039;&amp;gt; \n&amp;quot;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print &amp;quot;&amp;lt;input type=submit&amp;gt; \n&amp;quot;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; exit;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;}&lt;/code&gt;&lt;/div&gt;&#039;&lt;br /&gt;
Change &lt;strong&gt;$FORM{&#039;otherinfo&#039;}&lt;/strong&gt; to whatever other info you want to pass along.&lt;br /&gt;
I tried this out... should work&lt;/p&gt;
 </description>
     <pubDate>Sun, 21 Oct 2001 17:30:04 +0000</pubDate>
 <dc:creator>nike_guy_man</dc:creator>
 <guid isPermaLink="false">comment 1092022 at https://www.webmaster-forums.net</guid>
  </item>
  </channel>
</rss>
