RE: Problems getting a simple form to work.
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]
Re: Problems getting a simple form to work.
Mike Butler wrote: 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'); should be my $username = param('username'); When you are using strict all variables must be declared with the my. 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 Out of curiosity why is the simpleform.htm chmod 755 instead of 644? 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 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Problems getting a simple form to work.
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]
Any one who knows Formmail by Matts Scripts
Hallo I need to have my form mail to 2 or 3 addresses. Anyone familiar enough with this popular program to advise??? Thanks Lou -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Problems getting a simple form to work.
Thanks, Andrew. I added CGI::Carp qw(fatalsToBrowser); to the script. That's a big help. The error message that I get now is: Software error: Undefined subroutine main::param called at simpleform.cgi line 6. Line 6 is my $username = param('username'); Any idea why param is undefined? Thanks, - Mike -Original Message- From: Hughes, Andrew [mailto:[EMAIL PROTECTED] Sent: Friday, April 04, 2003 3:09 PM To: [EMAIL PROTECTED] Subject: RE: Problems getting a simple form to work. I would also add use CGI::Carp qw(fatalsToBrowser); along with use CGI; use strict; This way your errors will get displayed in your browser. Also, check with your hosting company to make sure that your path to perl is correct (ex. is it #!/usr/local/bin/perl -wT vs. #!/usr/bin/perl -wT) Andrew -Original Message- From: Li Ngok Lam [mailto:[EMAIL PROTECTED] Sent: Friday, April 04, 2003 2:37 PM To: Mike Butler; [EMAIL PROTECTED] Subject: Re: Problems getting a simple form to work. [..] #!/usr/local/bin/perl -wT use CGI; use strict; $username = param('username'); should be : my $username = param('username'); because you've using strict; print Content-type: text/plain\n\n; For what I know, I would write as Content-type: text/html\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;. 2 suggestion here : 1. use CGI::Carp 'fatalsToBrowser'; # the die message will goto your browser. 2. Try simpler script, so you will know if your form is going to a right place : #!/usr/bin/perl print Content-type: text/html\n\n; print Hello world; -- 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] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Problems getting a simple form to work.
Undefined subroutine main::param called at simpleform.cgi line 6. Is the error I get for your script when I execute it from http://www.mikyo.com/cgi-bin/simpleform.cgi If you want to try what I did, do the following: 1. type in http://www.mikyo.com/cgi-bin/simpleform.cgi to your web browser 2. You will get the error above. Are you sure the CGI module is installed on Hypermart's servers? You can send them an email to see. CGI module is not a standard part of my web hoster either, so you might want to find a hosting site that will install it for you. There are ways you can install CPAN modules yourself on the Hypermart server, but I think you need to rebuild the module with some details about where you'll be installing it. This is covered in 12.7 and 12.17 in Perl Cookbook. Mark I tried to go to Hypermart to look at their CGI implementation, that is, where they say to get access to your CGI programs, but I couldn't until I signed up. They have a free option, but oddly they require a credit card even for the zero-dollar option. So, I would look at their CGI FAQ ( -Original Message- From: Mike Butler [mailto:[EMAIL PROTECTED] Sent: Friday, April 04, 2003 12:58 PM To: Li Ngok Lam; [EMAIL PROTECTED] Subject: RE: Problems getting a simple form to work. 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: Problems getting a simple form to work.
Give this a shot and see if it errors: use CGI; my $query = new CGI; my %params = $query-Vars; my $username = $params{'username'}; On Fri, 2003-04-04 at 15:29, Mike Butler wrote: Thanks, Andrew. I added CGI::Carp qw(fatalsToBrowser); to the script. That's a big help. The error message that I get now is: Software error: Undefined subroutine main::param called at simpleform.cgi line 6. Line 6 is my $username = param('username'); Any idea why param is undefined? Thanks, - Mike -Original Message- From: Hughes, Andrew [mailto:[EMAIL PROTECTED] Sent: Friday, April 04, 2003 3:09 PM To: [EMAIL PROTECTED] Subject: RE: Problems getting a simple form to work. I would also add use CGI::Carp qw(fatalsToBrowser); along with use CGI; use strict; This way your errors will get displayed in your browser. Also, check with your hosting company to make sure that your path to perl is correct (ex. is it #!/usr/local/bin/perl -wT vs. #!/usr/bin/perl -wT) Andrew -Original Message- From: Li Ngok Lam [mailto:[EMAIL PROTECTED] Sent: Friday, April 04, 2003 2:37 PM To: Mike Butler; [EMAIL PROTECTED] Subject: Re: Problems getting a simple form to work. [..] #!/usr/local/bin/perl -wT use CGI; use strict; $username = param('username'); should be : my $username = param('username'); because you've using strict; print Content-type: text/plain\n\n; For what I know, I would write as Content-type: text/html\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;. 2 suggestion here : 1. use CGI::Carp 'fatalsToBrowser'; # the die message will goto your browser. 2. Try simpler script, so you will know if your form is going to a right place : #!/usr/bin/perl print Content-type: text/html\n\n; print Hello world; -- 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] -- 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: Any one who knows Formmail by Matts Scripts
On Fri, 4 Apr 2003, Luinrandir Hernsen wrote: Hallo I need to have my form mail to 2 or 3 addresses. Anyone familiar enough with this popular program to advise??? Thanks Lou Lou, forget it; matt's formmail script has a lot of security flaws discussed in this list and others. Try http://nms-cgi.sourceforge.net/ as an alternative good choice regards, Abel Lucano DECODE SA [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Problems getting a simple form to work.
Thanks, Andrew. That did it. It's working now. :) :) :) Thanks everyone for all your help. - Mike -Original Message- From: Rob Benton [mailto:[EMAIL PROTECTED] Sent: Friday, April 04, 2003 4:38 PM To: Mike Butler Cc: Hughes, Andrew; [EMAIL PROTECTED] Subject: RE: Problems getting a simple form to work. Give this a shot and see if it errors: use CGI; my $query = new CGI; my %params = $query-Vars; my $username = $params{'username'}; On Fri, 2003-04-04 at 15:29, Mike Butler wrote: Thanks, Andrew. I added CGI::Carp qw(fatalsToBrowser); to the script. That's a big help. The error message that I get now is: Software error: Undefined subroutine main::param called at simpleform.cgi line 6. Line 6 is my $username = param('username'); Any idea why param is undefined? Thanks, - Mike -Original Message- From: Hughes, Andrew [mailto:[EMAIL PROTECTED] Sent: Friday, April 04, 2003 3:09 PM To: [EMAIL PROTECTED] Subject: RE: Problems getting a simple form to work. I would also add use CGI::Carp qw(fatalsToBrowser); along with use CGI; use strict; This way your errors will get displayed in your browser. Also, check with your hosting company to make sure that your path to perl is correct (ex. is it #!/usr/local/bin/perl -wT vs. #!/usr/bin/perl -wT) Andrew -Original Message- From: Li Ngok Lam [mailto:[EMAIL PROTECTED] Sent: Friday, April 04, 2003 2:37 PM To: Mike Butler; [EMAIL PROTECTED] Subject: Re: Problems getting a simple form to work. [..] #!/usr/local/bin/perl -wT use CGI; use strict; $username = param('username'); should be : my $username = param('username'); because you've using strict; print Content-type: text/plain\n\n; For what I know, I would write as Content-type: text/html\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;. 2 suggestion here : 1. use CGI::Carp 'fatalsToBrowser'; # the die message will goto your browser. 2. Try simpler script, so you will know if your form is going to a right place : #!/usr/bin/perl print Content-type: text/html\n\n; print Hello world; -- 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] -- 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: Problems getting a simple form to work.
I think you meant, Thanks, Rob. Andrew -Original Message- From: Mike Butler [mailto:[EMAIL PROTECTED] Sent: Friday, April 04, 2003 4:45 PM To: Rob Benton Cc: Hughes, Andrew; [EMAIL PROTECTED] Subject: RE: Problems getting a simple form to work. Thanks, Andrew. That did it. It's working now. :) :) :) Thanks everyone for all your help. - Mike -Original Message- From: Rob Benton [mailto:[EMAIL PROTECTED] Sent: Friday, April 04, 2003 4:38 PM To: Mike Butler Cc: Hughes, Andrew; [EMAIL PROTECTED] Subject: RE: Problems getting a simple form to work. Give this a shot and see if it errors: use CGI; my $query = new CGI; my %params = $query-Vars; my $username = $params{'username'}; On Fri, 2003-04-04 at 15:29, Mike Butler wrote: Thanks, Andrew. I added CGI::Carp qw(fatalsToBrowser); to the script. That's a big help. The error message that I get now is: Software error: Undefined subroutine main::param called at simpleform.cgi line 6. Line 6 is my $username = param('username'); Any idea why param is undefined? Thanks, - Mike -Original Message- From: Hughes, Andrew [mailto:[EMAIL PROTECTED] Sent: Friday, April 04, 2003 3:09 PM To: [EMAIL PROTECTED] Subject: RE: Problems getting a simple form to work. I would also add use CGI::Carp qw(fatalsToBrowser); along with use CGI; use strict; This way your errors will get displayed in your browser. Also, check with your hosting company to make sure that your path to perl is correct (ex. is it #!/usr/local/bin/perl -wT vs. #!/usr/bin/perl -wT) Andrew -Original Message- From: Li Ngok Lam [mailto:[EMAIL PROTECTED] Sent: Friday, April 04, 2003 2:37 PM To: Mike Butler; [EMAIL PROTECTED] Subject: Re: Problems getting a simple form to work. [..] #!/usr/local/bin/perl -wT use CGI; use strict; $username = param('username'); should be : my $username = param('username'); because you've using strict; print Content-type: text/plain\n\n; For what I know, I would write as Content-type: text/html\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;. 2 suggestion here : 1. use CGI::Carp 'fatalsToBrowser'; # the die message will goto your browser. 2. Try simpler script, so you will know if your form is going to a right place : #!/usr/bin/perl print Content-type: text/html\n\n; print Hello world; -- 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] -- 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: Problems getting a simple form to work.
On Fri, 4 Apr 2003 at 16:29, Mike Butler opined: MB:Thanks, Andrew. I added CGI::Carp qw(fatalsToBrowser); to the script. That's MB:a big help. The error message that I get now is: MB:Software error: MB:Undefined subroutine main::param called at simpleform.cgi line 6. MB: MB:Line 6 is my $username = param('username'); MB: MB:Any idea why param is undefined? you should reread the docs for CGI: use CGI; $q = new CGI; print $q-header; print $q-param('username'); etc. OR use CGI qw/:standard/; print header; print param('username'); etc. when you import the standard functions into your namespace, you don't need to create the CGI object. you *can't* do this: use CGI; print header; print param('username'); which i think is what you were originally trying to do. perldoc CGI or, if you don't have access to a shell try http://search.cpan.org/author/LDS/CGI.pm-2.91/CGI.pm -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]