I am writing a usr login program, my perl are list as following. in "Line 123" what i am trying to do is if a user missing some informatin say username, use will be prompted to input username but all other information will be sent back to the registration form, so user do not need to re input all the information again. (you can see my website from http://apidb.org/regstr.html)
but this code does not work, if a user left all filed blank before he submit, some very strang information will be sent back to the registraiton form with waring messge. like in the firsname field will have size=15, which is not provided by user. How can i fix this problem? Thanks ************************************************ #Get user's input my $username = $query->param("username"); my $email = $query->param("email"); my $password1 = $query->param("password1"); my $password2 = $query->param("password2"); my $fname = $query->param("fname"); my $lname = $query->param("lname"); if(!$username||!$email|| !$password1||!$password2) { print h4("Field with * can not be empty"); regstrForm($username, $password1, $password2, $email, $fname,$lname);# ""Line 123"" #to sent usr-provided info back to the registration form # return; } sub regstrForm { print " <FORM ACTION=/cgi-bin/regstr.pl METHOD=POST> <TABLE width='640' align='center' cellpadding=2 cellspacing=10> <TR> <TD><font color='#003399' size=3><b>Please register: </b></font></TD> </TR> <TR> <TD>*User Name:</TD> <TD><INPUT NAME='username' ALIGN='left' SIZE='20' VALUE=$_[0]></TD> </TR> <TR> <TD>*Password:</TD> <TD><INPUT NAME='password1' Type=password ALIGN='left' VALUE=$_[1] SIZE='20'></TD> </TR> <TR> <TD>*Retype Password:</TD> <TD><INPUT NAME='password2' Type=password VALUE=$_[2] ALIGN='left' SIZE='20'></TD> </TR> <TR> <TD>*Email:</TD> <TD><INPUT NAME='email' Type=text VALUE=$_[3] ALIGN='left' SIZE='40'></TD> </TR> <TR> <TD>First Name:</TD> <TD><INPUT ALIGN=left NAME='fname' VALUE=$_[4] SIZE=15></TD> </TR> <TR> <TD>Last Name:</TD> <TD><INPUT ALIGN=left NAME=lname VALUE=$_[5] SIZE=15></TD> </TR> <TR> <TD><INPUT ALIGN = RIGHT TYPE='submit' NAME='Submit' VALUE='Register'></TD> <TD><INPUT ALIGN = LEFT TYPE='reset' VALUE=Reset></TD> </TR> </TABLE> </FORM> <h4>*Required field</h4> " ****************************************************************************** *********************************************************************** -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]