Hi Xiongfei,
By looking at the source of the html, i wold suggest you wrap with quotes the default
values of the form fields (i.e attribute VALUE=)
Example:
TR
TD*Password:/TD
TDINPUT NAME='password1' Type=password ALIGN='left'
VALUE='$_[1]' SIZE='20'/TD
/TR
That way, if $_[1] is blank, the browser won't mistake SIZE='20' to be the default
value of password1.
Hope that helps,
Etienne Rivard
Xiongfei Wang[EMAIL PROTECTED] 03/05/03 01:40pm
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
TDfont color='#003399' size=3bPlease register:
/b/font/TD
/TR
TR
TD*User Name:/TD
TDINPUT NAME='username' ALIGN='left'
SIZE='20' VALUE=$_[0]/TD
/TR
TR
TD*Password:/TD
TDINPUT NAME='password1' Type=password ALIGN='left'
VALUE=$_[1] SIZE='20'/TD
/TR
TR
TD*Retype Password:/TD
TDINPUT NAME='password2' Type=password
VALUE=$_[2] ALIGN='left' SIZE='20'/TD
/TR
TR
TD*Email:/TD
TDINPUT NAME='email' Type=text
VALUE=$_[3] ALIGN='left' SIZE='40'/TD
/TR
TR
TDFirst Name:/TD
TDINPUT ALIGN=left NAME='fname'
VALUE=$_[4] SIZE=15/TD
/TR
TR
TDLast Name:/TD
TDINPUT ALIGN=left NAME=lname
VALUE=$_[5] SIZE=15/TD
/TR
TR
TDINPUT ALIGN = RIGHT TYPE='submit' NAME='Submit'
VALUE='Register'/TD
TDINPUT 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]
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]