<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://www.webmaster-forums.net/crss/node/1033572" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title></title>
    <link>https://www.webmaster-forums.net/crss/node/1033572</link>
    <description></description>
    <language>en</language>
          <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/cgi-form-validation-help-required#comment-1195614</link>
    <description> &lt;p&gt;Here&#039;s some sample code that may be the type of thing you&#039;re looking for. Also, there&#039;s a decent guide to Perl&#039;s regular expressions here:&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.troubleshooters.com/codecorn/littperl/perlreg.htm&quot; class=&quot;bb-url&quot;&gt;http://www.troubleshooters.com/codecorn/littperl/perlreg.htm&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;# Create blank error message so we can check at the end if there were any errors.&lt;br /&gt;my $errormessage = &amp;#039;&amp;#039;;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;# Check the address to simply see if there&amp;#039;s anything there&lt;br /&gt;if ($address eq &amp;#039;&amp;#039;)&lt;br /&gt;{&lt;br /&gt;	# Failed the check, so see if we need to add a comma to the error message&lt;br /&gt;	if ($errormessage ne &amp;#039;&amp;#039;)&lt;br /&gt;	{&lt;br /&gt;		$errormessage .= &amp;quot;, &amp;quot;;&lt;br /&gt;	}&lt;br /&gt;	$errormessage = &amp;quot;Address&amp;quot;;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;# Check the name to make sure it only uses alphabetical characters and spaces, and&lt;br /&gt;# that there&amp;#039;s at least one character (ie it&amp;#039;s not blank)&lt;br /&gt;if (!($name =~ /^[A-z\s]+$/))&lt;br /&gt;{&lt;br /&gt;	# Failed the check, so see if we need to add a comma to the error message&lt;br /&gt;	if ($errormessage ne &amp;#039;&amp;#039;)&lt;br /&gt;	{&lt;br /&gt;		$errormessage .= &amp;quot;, &amp;quot;;&lt;br /&gt;	}&lt;br /&gt;	$errormessage = &amp;quot;Name (blank or invalid character)&amp;quot;;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;# Check the phone number to make sure there&amp;#039;s at least 7 characters, and they are &lt;br /&gt;# either numbers, dashes, open parenthesis or close parenthesis&lt;br /&gt;if (!($phone =~ /^[0-9\-()]{7,}$/))&lt;br /&gt;{&lt;br /&gt;	# Failed the check, so see if we need to add a comma to the error message&lt;br /&gt;	if ($errormessage ne &amp;#039;&amp;#039;)&lt;br /&gt;	{&lt;br /&gt;		$errormessage .= &amp;quot;, &amp;quot;;&lt;br /&gt;	}&lt;br /&gt;	$errormessage = &amp;quot;Phone (blank or invalid format)&amp;quot;;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;# Check the email to make sure the beginning has valid characters and that there&amp;#039;s at&lt;br /&gt;# least one character. After that, there should be an @, then more valid characters&lt;br /&gt;# (one or more), then a period, then 2-4 alphabetical characters&lt;br /&gt;if (!($email =~ /^[A-z0-9_\-]+\@(A-z0-9_-]+\.)+[A-z]{2,4}$/))&lt;br /&gt;{&lt;br /&gt;	# Failed the check, so see if we need to add a comma to the error message&lt;br /&gt;	if ($errormessage ne &amp;#039;&amp;#039;)&lt;br /&gt;	{&lt;br /&gt;		$errormessage .= &amp;quot;, &amp;quot;;&lt;br /&gt;	}&lt;br /&gt;	$errormessage = &amp;quot;Email (blank or invalid format)&amp;quot;;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;if ($errormessage ne &amp;#039;&amp;#039;)&lt;br /&gt;{&lt;br /&gt;	print &amp;#039;The following fields had errors: &amp;#039; . $errormessage;&lt;br /&gt;	exit;&lt;br /&gt;}&lt;/code&gt;&lt;/div&gt;&#039;&lt;/p&gt;
 </description>
     <pubDate>Mon, 20 Mar 2006 13:48:18 +0000</pubDate>
 <dc:creator>timjpriebe</dc:creator>
 <guid isPermaLink="false">comment 1195614 at https://www.webmaster-forums.net</guid>
  </item>
  </channel>
</rss>
