cgi script that throws a Software Error" message
I have a cgi script that throws an error:"Software Error"

Here is how I call the script from PHP:

    `<iframe src= "/usr/lib/cgi-bin/check_data.pl" height="0" width="0" ></frame>`


We wish to find submission errors in the following form:
 

    		<form method='post' action='/http://www.htmlcodetutorial.com/cgi-bin/mycgi.pl'  > 
    	<center> 
    			First Name: <input type='text' name='Fname' ></input>
    		    Last  Name: <input type='text' name='Lname' ></input><br /> 
    	
       </center>
       <div id="I1">Ten Characters</div>  <div id="I2"> Twenty Characters</div><br /><br /> 
    	<center>		
    		Phone: <input type="text" name="Phone" ></input>
    		Height: <input type="text" name="Height" ></input><br ></center>
    		<div id="I3">XXX-XXX-XXXX</div>  <div id= "I4">  Inches</div><br /><br />
    		<center>Birthday: <input type='text' name='Bday'  /></input><br />	
    		
    		
    <?php	printf(" \t\t\t\t YYYY-MM-DD   \n\n"); 
    ?> 	
    		<p ><input type="radio" name="Sex" value = "0"/>Male
    		<input type="radio" name="Sex" value = "1"/>Female  </p >
    		Hx: <br /> 
    		<textarea style="overflow: scroll" cols="60" rows="10" wrap="hard" name="Hx" ></textarea> <p />
    		<br /><br /><input type="submit" />
    		<br /><br /><input type = "reset" value="Clear Form"/></center>
    		<input type=hidden name='welcome_already_seen'   value='already_seen'>
    		</form>

From the following script the "Software Error"  is thrown

Here is the script:

    `#!/usr/bin/perl
    print "Content-type: text/html\n\n";
    use CGI qw(:standard);
    use CGI::Carp qw(warningsToBrowser fatalsToBrowser);
    
    
    		 @errors_array = "";
    
         @POST=("Fname", "Lname", "Lname", "Height","Phome", "Bday" );
    		
    	if(!empty(@POST['Fname']))
    			if (@matches('#^[a-zA-Z-]{1,10}$#', @POST['Fname']) == 0)
    	{
            
     	       $errors_array[] = "<center><b><font color='red'>First Name has a maximum legnth of 10 characters; Text and Underdscore</font></center></b>";
            }
    			
    	
    	if(!empty(@POST['Lname']))
    			if (@matches('#^[a-zA-Z-]{1,20}$#', @POST['Fname']) == 0)
            {
     	       $errors_array[] = "<center><b><font color='red'>First Name has a maximum legnth of 10 characters; Text and Underdscore</font></center></b>";
            }
    		
            
            if(!empty(@POST['Height']))
            	if(@matches('#^[5-6]{1}$|^[5-6]{1}[0-9]{1}$#', @POST['Height']) == 0)
            {
     	       $errors_array[] = "<center><b><font color='red'>Height must be between 50 and 69</font></center></b>";
            }
          
            
            if(!empty(@POST['Phone']))
            	if(@matches('#^\d{3}-\d{3}-\d{4}$#', @POST['Phone']) == 0)
            {
            	$errors_array[] = "<center><b><font color='red'>Phone Format xxx-xxx-xxxx</font></center></b>";
            }
    
        

    
            if(!empty(@POST['Bday']))
            	if(@matches('#^\d{4}-\d{2}-\d{2}$#', @POST['Bday']) == 0)
            {
            	$errors_array[] = "<center><b><span style= 'color:red; font-size: 12pt;'>Birth Date Format yyy-mm-dd</span></center></b>";
    
            }`

Thanks.

Ethan Rosenberg









cgi script that throws a Software Error" message
===

I have a cgi script that throws an error:"Software Error"

Here is how I call the script from PHP:

    `<iframe src= "/usr/lib/cgi-bin/check_data.pl" height="0" width="0" ></frame>`


We wish to find submission errors in the following form:
 

    		<form method='post' action='/http://www.htmlcodetutorial.com/cgi-bin/mycgi.pl'  > 
    	<center> 
    			First Name: <input type='text' name='Fname' ></input>
    		    Last  Name: <input type='text' name='Lname' ></input><br /> 
    	
       </center>
       <div id="I1">Ten Characters</div>  <div id="I2"> Twenty Characters</div><br /><br /> 
    	<center>		
    		Phone: <input type="text" name="Phone" ></input>
    		Height: <input type="text" name="Height" ></input><br ></center>
    		<div id="I3">XXX-XXX-XXXX</div>  <div id= "I4">  Inches</div><br /><br />
    		<center>Birthday: <input type='text' name='Bday'  /></input><br />	
    		
    		
    <?php	printf(" \t\t\t\t YYYY-MM-DD   \n\n"); 
    ?> 	
    		<p ><input type="radio" name="Sex" value = "0"/>Male
    		<input type="radio" name="Sex" value = "1"/>Female  </p >
    		Hx: <br /> 
    		<textarea style="overflow: scroll" cols="60" rows="10" wrap="hard" name="Hx" ></textarea> <p />
    		<br /><br /><input type="submit" />
    		<br /><br /><input type = "reset" value="Clear Form"/></center>
    		<input type=hidden name='welcome_already_seen'   value='already_seen'>
    		</form>

From the following script the "Software Error"  is thrown

Here is the script:

    `#!/usr/bin/perl
    print "Content-type: text/html\n\n";
    use CGI qw(:standard);
    use CGI::Carp qw(warningsToBrowser fatalsToBrowser);
    
    
    		 @errors_array = "";
    
         @POST=("Fname", "Lname", "Lname", "Height","Phome", "Bday" );
    		
    	if(!empty(@POST['Fname']))
    			if (@matches('#^[a-zA-Z-]{1,10}$#', @POST['Fname']) == 0)
    	{
            
     	       $errors_array[] = "<center><b><font color='red'>First Name has a maximum legnth of 10 characters; Text and Underdscore</font></center></b>";
            }
    			
    	
    	if(!empty(@POST['Lname']))
    			if (@matches('#^[a-zA-Z-]{1,20}$#', @POST['Fname']) == 0)
            {
     	       $errors_array[] = "<center><b><font color='red'>First Name has a maximum legnth of 10 characters; Text and Underdscore</font></center></b>";
            }
    		
            
            if(!empty(@POST['Height']))
            	if(@matches('#^[5-6]{1}$|^[5-6]{1}[0-9]{1}$#', @POST['Height']) == 0)
            {
     	       $errors_array[] = "<center><b><font color='red'>Height must be between 50 and 69</font></center></b>";
            }
          
            
            if(!empty(@POST['Phone']))
            	if(@matches('#^\d{3}-\d{3}-\d{4}$#', @POST['Phone']) == 0)
            {
            	$errors_array[] = "<center><b><font color='red'>Phone Format xxx-xxx-xxxx</font></center></b>";
            }
    
        

    
            if(!empty(@POST['Bday']))
            	if(@matches('#^\d{4}-\d{2}-\d{2}$#', @POST['Bday']) == 0)
            {
            	$errors_array[] = "<center><b><span style= 'color:red; font-size: 12pt;'>Birth Date Format yyy-mm-dd</span></center></b>";
    
            }`

Thanks.

Ethan Rosenberg








