PDA

View Full Version : Not even with a stick...!


marcomorales
03-08-2003, 05:06 PM
G´day... any help appreciated!
I´ve downloaded a formMail.pl and a test form, but it just isn´t working ... I get a ´Internal Server Error´ when I test, and that´s as far as it will go.

The bits I´ve changed in the formmail Version 1.92 are;

$mailprog = '/usr/sbin/sendmail -i -t';

# @referers = ('triborgsolutions.com','216.120.236.61');
# @referers = ('^marco\@triborgsolutions\.com');
@referers = ('marco@triborgsolutions.com');
(I´ve tried all three methods)

@recipients = &fill_recipients(@referers);

... then the bits at the form end (http://www.triborgsolutions.com/testform.htm) are:

<form action="cgi-bin/formmail.pl" method="POST" name="form1" >
Enter Anything:
<input type="text" name="myTextfield">
<input type="submit" name="Submit" value="Submit">
<input type="hidden" name="recipient" value="marco@triborgsolutions.com">
</form>


... anyway, this just doesn´t work. I get that 500 error... any ideas??

PS. is there a formmail i´m supposed to download from HR? I couldn´t find it, so I downloaded the 1.92 version instead... Cheers!

don5408
03-08-2003, 05:38 PM
"I get a ´Internal Server Error´ when I test"

Hi. After you get the error head directly to "Error Logs" in your HR Control Panel, there you should find specific details on the 500 error you jusr received. These details often provide clues as to the nature of the problem, if you can't make heads nor tails feel free to copy > paste the specifics to this thread.

Offhand everything looks good with your script provided the script you uploaded to your cgi-bin folder is in fact named "formmail.pl". I mention this as Matt Wright's formmail script is commonly named FormMail.pl and for your test form to work as is you would have had to rename the script (as file names are case sensitive a form calling formmail.pl will *not* work if the script is named FormMail.pl)

"PS. is there a formmail i´m supposed to download from HR? I couldn´t find it, so I downloaded the 1.92 version instead"

There isn't any special HR version you have to download as such however HostRocket *does* have a preloaded FormMail script available for use on all accounts via the global cgi-sys directory. If you wish you can try using that as an alternative, and by so doing sidestep any need to modify and upload any files.

To use the FormMail script already in place all you have to upload is a form calling /cgi-sys/FormMail.pl which has a @triborgsolutions.com recipient. Try the following as is as an alternate test form:

<form action="/cgi-sys/FormMail.pl" method="POST">
<input type="hidden" name="recipient" value="marco@triborgsolutions.com">
Enter Anything: <input type="text" name="sometext">
&nbsp;<input type="submit" name="Submit" value="Submit">
</form>

Don

marcomorales
03-09-2003, 05:02 AM
Thank you for the info... now I know a few more things I didn´t know before!

I tried using the cgi-sys, and it works. Is there any way to access that file? I couldn´t find it as I roamed the ftp...

Aside from that, i would still prefer having my ´own´ script; i tend to use flash and scripts to ´talk´ to each other, and usually these forms are designed for html. (for example, I rather not have a redirection page), and also hope that if I work out what i´m doing wrong, i won´t have the same problem every time i try to do something with perl ...

but i´m digressing. I checked the error log:

[Sat Mar 8 21:13:54 2003] [error] [client 62.151.157.60] File does not exist: /home/triborg/public_html/500.shtml [Sat Mar 8 21:13:54 2003] [error] [client 62.151.157.60] Premature end of script headers: /home/triborg/public_html/cgi-bin/formmail.pl

and i´ve put the formmail.pl that i´m using in .txt format here:

http://www.triborgsolutions.com/formmail.txt

thank you in advance for the continuing help...!

don5408
03-09-2003, 03:51 PM
"I tried using the cgi-sys, and it works."

Good deal, happy to hear of your progress!

"Is there any way to access that file?"

No. While all of the various preloaded scripts in the cgi-sys folder can be executed from all accounts there is no user access or write permission for the obvious reasons. In any case all of the scripts available within the cgi-sys are of the type where all user customization options and variables are implemented via entries in the code which calls the script so there's really little to any need for modification of the scripts themselves (and when/if there is there is always the option of one uploading their own local copy of the script to the cgi-bin folder).

"i would still prefer having my ´own´ script; i tend to use flash and scripts to ´talk´ to each other, and usually these forms are designed for html."

Well if you're referring to having your own copy of FormMail.pl I'm not clear on exactly how having your own local file would make any difference in this regard however this is an instance where personal preference alone is more than sufficient (i.e. "just because I wanna" works for me ;-) and uploading your own file is certainly an option available to you.

"for example, I rather not have a redirection page"

Well as with all FormMail options control over redirection is implemented via variables within your form tags rather than changes within the script. You can find documentation on all supported FormMail options under FormMail in your HR Control Panel.

You have several options as far as where the user ends up after clicking the Submit button. By default if one doesn't include a redirect tag in their form the user will be directed to a generic "Form Submission Results" page showing the output of their submission. The downside to this is that it leaves the user 'dead ended' with no way of navigating other than using their browser's Back button.

To avoid this one can add a redirect tag to their form specifying where the user is to be directed after a successful form submission. You can use a redirect tag to automatically direct the user to a custom 'thanks for submitting' page with a link either back to the page containing the form or forward to some other page, you can forward them to any page of your choosing, or by specifying the URL of the original page containing the form you can effectively have them stay right where they are. Although rarely used it's also possible to either offer users a choice of forward destinations and/or a text entry field in which they themselves specify the URL which they wish to be taken to as part of the form.

The syntax for redirect is as follows, where URL = the page you wish those successfully submitting via your form to be forwarded to:

<input type="hidden" name="redirect" value="URL">

"[error] [client 62.151.157.60] Premature end of script headers: /home/triborg/public_html/cgi-bin/formmail.pl"

This particular error often indicates a formatting problem with the script itself, which can result from either uploading the script in Binary rather than ASCII mode or from opening/editing the script in a word processor or program other than a basic ASCII text editor such as Windows NotePad or DOS EDIT.COM.

If you wish to persue installing your own local copy of the FormMail script (and I agree that above and beyond any practical considerations completing this mission does make sense if only as a 'learning experience') I'd suggest starting over at square one by downloading a fresh copy of the FormMail.pl file. Make sure that you only open/edit the file in an ASCII text editor such as NotePad and make sure that you upload the file in ASCII mode.

Best o' luck!
Don