RE: Problems getting a simple form to work.

2003-04-04 Thread Etienne Rivard
Hi,

 You have access to your error log in Hypermart through the site tools.  Simply click 
on Site Statistics then on CGI Error Log and you'll find the most recent errors.

Etienne Rivard


 Mike Butler[EMAIL PROTECTED] 04/04/03 01:57pm 
Hi Li, Rob and Mark.

Thanks for your help. My site is being hosted by Hypermart, so I don't have
access to /var/log/httpd. My new simpleform.cgi now looks like this:

#!/usr/local/bin/perl -wT
use CGI;
use strict;

$username = param('username');

print Content-type: text/plain\n\n;
print You entered: $username\n;

The permissions look like this:

Permissions for cgi-bin: rwxr-xr-x
Permissions for simpleform.cgi rwxr-xr-x
Permissions for simpleform.htm: rwxr-xr-x

I have changed form method=post action=../cgi-bin/simpleform.pl to
form method=post action=http://www.mikyo.com/cgi-bin/simpleform.cgi;.

I am still getting the 500 error.

Thanks,

  - Mike

-Original Message-
From: Li Ngok Lam [mailto:[EMAIL PROTECTED] 
Sent: Friday, April 04, 2003 1:16 PM
To: Mike Butler; [EMAIL PROTECTED] 
Subject: Re: Problems getting a simple form to work.


[..]

 Can anyone tell me what I'm doing wrong? Also, is there a way to turn on
 error.log?

Actually, error.log is always turned on... If you are not running the server
on
yours own, ask the server admin where is the error.log located.

[..]

 Permissions for cgi-bin: rwxr-xr-x
 Permissions for simpleform.htm: rwxr-xr-x

What about your script ?  simpleform.pl

[..]

 #!/usr/local/bin/perl

use CGI; # You missed this

 $username = param('username');

You can't ask a value from param without use CGI in this case.


 print Content-type: text/plain\n\n;
 print You entered: $username\n;


One more point, when you are going to write a script for real running,
always use strict You will know how pain it is to remember all the
var names that you've declared along the whole script. And most likely
have to rewrite the whole thing again when touching to maintenence or
debugging...


-- 
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]



Re: what wrong with this code

2003-03-05 Thread Etienne Rivard
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]