bconza Posted November 3, 2005 Posted November 3, 2005 I am trying to develop a CGI script in Perl which will process an HTML form and send an email message. I need to know the proper Perl header and also the location of the Sendmail program. I'm fairly sure the Perl header should be #!/usr/local/bin/perl - is that right? I'm told the sendmail should be something like... $mail_prog = '/usr/lib/sendmail' Help!! Thanks in advance, Brannon Quote
TCH-Bruce Posted November 3, 2005 Posted November 3, 2005 Welcome to the forums Brannon That would be >#!/usr/bin/perl $mailprog = '/usr/sbin/sendmail -t' Quote
bconza Posted November 3, 2005 Author Posted November 3, 2005 Thanks all! We'll see how this goes!! Quote
bconza Posted November 3, 2005 Author Posted November 3, 2005 (edited) Okay, set those locations as outlined above: and I'm getting this error message: Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, webmaster@premierbusinessdesigns.com and inform them of the time the error occurred, and anything you might have done that may have caused the error. More information about this error may be available in the server error log. Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request. I set the action to http://www.premierbusinessdesigns.com/cgi-bin/FormScript.cgi (with premierbusinessdesigns.com being my site, of course) Am I putting the file in the wrong location on the server, calling the action wrong or both? I think its going to be a long day. Edited November 3, 2005 by bconza Quote
TCH-Bruce Posted November 3, 2005 Posted November 3, 2005 Did you upload the file in ASCII mode and did you change the permissions to 755? And you form action should look something like this: ><form action="http://www.premierbusinessdesigns.com/cgi-bin/FormScript.cgi" method="post"> Case matters. So if your script is FormScript.cgi that should be fine. Quote
bconza Posted November 3, 2005 Author Posted November 3, 2005 Did you upload the file in ASCII mode and did you change the permissions to 755? And you form action should look something like this: ><form action="http://www.premierbusinessdesigns.com/cgi-bin/FormScript.cgi" method="post"> Case matters. So if your script is FormScript.cgi that should be fine. Uploaded in ASCII, permissions are 755 - and the case for FormScript.cgi is as indicated. When it comes to the coding - I am using Dreamweaver and editing the tags through there - so I have the action set as http://www.premierbusinessdesigns.com/cgi-bin/FormScript.cgi - and I have the method tag set to post. Quote
bconza Posted November 3, 2005 Author Posted November 3, 2005 Also, just checked the code section of Dreamweaver, and this is what I have: <form action="http://www.premierbusinessdesigns.com/cgi-bin/FormScript.cgi" method="post" name="form1"> Quote
bconza Posted November 3, 2005 Author Posted November 3, 2005 Okay, kinda blew myself away here, but I figured it out! Had a tad of extraneous code for the sendmail - just tested it and it works, thanks for all of your help!! Quote
TCH-Bruce Posted November 3, 2005 Posted November 3, 2005 Well without seeing the actual script it's going to be hard to help you debug it. The other times I get Internal Server errors is if I don't escape a quote when needed or @ in an email address. Double check the entire script and make sure you have everything escaped that needs escaped and are ending your lines with a semi-colon. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.