I need help. I have some very simple questions in Perl/CGI but I am new in Perl and although I tried to read as much as possible, I am still so confused and don't know where to start. Following is html file for a form:
==
<form METHOD="POST" ACTION="/cgi-bin/name.pl">
Account Number: <INPUT TYPE="text" SIZE=25 NAME="accountnum">
Name: <INPUT TYPE="text" SIZE=25 NAME="name" MAXLENGTH=45>
Street: <INPUT TYPE="text" SIZE=25 NAME="street">
City: <INPUT TYPE="text" SIZE=25 NAME="city" >
State: <INPUT TYPE="text" SIZE=25 NAME="state" >
Zip: <INPUT TYPE="text" SIZE=25 NAME="zip" >
Balance: <INPUT TYPE="text" SIZE=25 NAME="balance" >
<hr>
Look up: <INPUT TYPE="radio" NAME="info" VALUE="lookup" CHECKED>
Add to database: <INPUT TYPE="radio" NAME="info" VALUE="addb">
<hr>
==
1. I will create a database to add info input by users. How do I write a CGI script to check if the radio button, let say "addb" is the choice, then to add account number?
2. How do I verify to make sure all text fields are not blank?
Thank you.
==
<form METHOD="POST" ACTION="/cgi-bin/name.pl">
Account Number: <INPUT TYPE="text" SIZE=25 NAME="accountnum">
Name: <INPUT TYPE="text" SIZE=25 NAME="name" MAXLENGTH=45>
Street: <INPUT TYPE="text" SIZE=25 NAME="street">
City: <INPUT TYPE="text" SIZE=25 NAME="city" >
State: <INPUT TYPE="text" SIZE=25 NAME="state" >
Zip: <INPUT TYPE="text" SIZE=25 NAME="zip" >
Balance: <INPUT TYPE="text" SIZE=25 NAME="balance" >
<hr>
Look up: <INPUT TYPE="radio" NAME="info" VALUE="lookup" CHECKED>
Add to database: <INPUT TYPE="radio" NAME="info" VALUE="addb">
<hr>
==
1. I will create a database to add info input by users. How do I write a CGI script to check if the radio button, let say "addb" is the choice, then to add account number?
2. How do I verify to make sure all text fields are not blank?
Thank you.