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.
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.
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]
Problem Installing NMS FormMail
I'm trying to install the NMS FormMail program on a clients web site. I think that I have done everything correctly but when I test the script I get the following error message: Application Error An error has occurred in the program close sendmail pipe failed, mailprog=[/usr/sbin/sendmail -oi -t] at /usr/home/rf/.public_html/cgi-bin/FormMail.pl line 645. Here is the code that the error is referencing: sub email_end { if (defined $smtp) { smtp_command(.); smtp_command(QUIT); undef $smtp; } else { close SENDMAIL or die close sendmail pipe failed, mailprog=[$mailprog]; == Line 645 } } Does anyone have any suggestions about how to debug this? Is it a problem with sendmail? Thanks so much, - Mike __ Post your free ad now! http://personals.yahoo.ca -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Uploading files to a web site status bar.
I need to create a status bar for users who are uploading pdf files, some of them quite large, to a web site. Some of the users are on dial-up and the upload time could be quite lengthy, so they need to know that their upload is progressing and not to cancel the operation. Is there a way to do this in Perl? Thanks, Mike Butler = email: [EMAIL PROTECTED] web: www.hotlux.com and www.mikyo.com __ Send your holiday cheer with http://greetings.yahoo.ca -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]