View Full Version : Pulling out hair! Form-argh
Regor
01-20-2003, 09:23 PM
I've sent trouble tickets, I've read through old threads, (now that the forum is back up), and no luck.
I have wrote the most basic of forms, and I keep going in circles, and it mostly ends up with the same errors:
===============================
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, webmaster@thehubers.net 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.
=================================
Maybe someone will see something right off the bat from my files.
Files are executable (755).
http://www.thehubers.net/testform.html
Thanks
Regor
don5408
01-21-2003, 01:34 AM
"More information about this error may be available in the server error log"
Hi. As suggested the error log indeed did tell the tale...the problem here is a syntax error in your formmail script. Adter modifying only the @referers and @recipients values I uploaded your files as is and upon testing I promptly got a 500 error. A check under Error Logs in the HR Control Panel yielded the following details:
Premature end of script headers:
/home/userid/public_html/test/formmail.pl
Execution of (formmail.pl) aborted due to compilation errors. syntax error at (formmail.pl) line 685, near "/BODY>
The line in question (685) is the last line in the formmail.cgi file you uploaded (the line with the </XMP> tag). I'm not sure how that line got there however it clearly doesn't belong...the file should end at line 684, that final line which is hosing the script appears to have been appended.
677 </html>
678 (END ERROR HTML)
679 }
680 }
681
682 exit;
683 }
684
685 </XMP></BODY></HTML>
What programs did you use to open/view/edit this file? If you didn't intentionally make any changes to the script other than the expected ones to the variables it's possible that whatever text editor/word processor/WYSIWYG hypertext editor(s) you may have used may have appended the problematic line automatically. For the best results I'd suggest sticking to a basic ASCII text editor a la Windows NotePad or DOS EDIT.COM for editing Perl scripts, using other programs can add lines of text and/or proprietary text formatting which can cause problems.
Suggestions:
While you *could* simply fix the existing script (open your formmail.cgi file in NotePad, highlight and remove the last line in the script, resave and reupload the file, retry your form) as I noticed that the FormMail script you are using is version 1.9 (an older, insecure version whose use is prohibited on HostRocket's servers) I'd strongly suggest that you download a copy of the more secure v1.92 FormMail (http://www.scriptarchive.com/formmail.html) and start "fresh" making your changes via NotePad.
If you have any problems be aware that you don't *necessarily* have to upload your own FormMail script, I'm pretty sure that HR has a copy preinstalled in the shared cgi-sys folder on all servers. Try uploading this alternate version of your testform.html file, it *should* work as is without your having to edit and upload your own Perl script:
<HTML>
<HEAD>
<TITLE>Test Form</TITLE>
</HEAD>
<BODY>
<FORM METHOD="POST" ACTION="/cgi-sys/FormMail.pl">
<INPUT TYPE="hidden" NAME="recipient" VALUE="greg@thehubers.net">
<INPUT TYPE="hidden" name="subject" VALUE="Test Form">
<INPUT TYPE="hidden" NAME="form" VALUE="http://www.thehubers.net">
Your Initials: <INPUT TYPE="text" NAME="from" SIZE="30">
<input type=submit value="Go!">
</form>
</BODY>
</HTML>
Hope that helps!
Don
Regor
01-21-2003, 09:30 AM
"Hope that helps!
Don"
Thanks Don. I will get to work on this today, in-between that other thing I do (work that pays the bills).
I have been using Notepad only, to do my editing, so not sure were that line came from.
A couple things you noted that I am unsure of:
~ What is the typical path of the systems cgi-sys?
~ What is the path of the servers error log? A look under MY CP Error log shows nothing.
None of my question above seem posted anywhere for us newbies.
Thanks
Regor
don5408
01-21-2003, 05:23 PM
"I have been using Notepad only, to do my editing, so not sure were that line came from."
Not sure either...in any case no matter what the source it doesn't appear to belong and it seems to be the cause of the problem.
"What is the typical path of the systems cgi-sys?"
It's linked as if it were a subdirectory of your public_html folder, you can call scripts in the cgi-sys directory it just as you would call scripts in cgi-bin (ex: you can use the absolute path http://yourdomain.com/cgi-sys/FormMail.pl to call FormMail from anywhere on your account or the relative path /cgi-sys/FormMail.pl if your form is stored in your public_html folder, ../cgi-sys/FormMail.pl if your form is stored in a subdirectory of public_html etc).
"What is the path of the servers error log? A look under MY CP Error log shows nothing."
I don't know where the actual error logs are stored however as far as seeing nothing listed under Error Logs in my experience that's not unusual. I suspect that the error logs may be cleared constantly on an ongoing basis as I find that it's normal for the errors listed to only appear for a brief period of time...whenever you see a 500 error (for example immediately after attempting to use the form which calls the hosed formmail.cgi file) if you go directly to Error Logs in Control Panel you *should* find details on the error.
Best wishes
Don
Regor
01-21-2003, 06:52 PM
Thanks again Don! I've had success!
It worked instantly when I pointed to the cgi-sys/formmail, and took a little extra work when getting it to work under my cgi-bin.
A couple clues for others to learn from:
~ When I used cute_ftp and attempted to D/L my formmail.cgi from the server to my PC, it said "you are trying to d/l a binary". I know for a fact that I U/L as ascii, so something corrupted along the way.
~ While D/L formmail.pl from misc sites, they would d/l in different formats, and looked different when opening in notepad. Pay attention to the end of line characters, and extra code appended to ? end of file.
The only thing I have not seen anyone touch on the forum so far is the answer to:
How to use formmail and get a file to upload?
Thanks
Regor
vBulletin® v3.7.0, Copyright ©2000-2009, Jelsoft Enterprises Ltd.