Forum Moderators: coopster & phranque

Message Too Old, No Replies

Form Help..

Help with Perl/CGI and sending form via email

         

tggon

4:50 pm on Apr 22, 2004 (gmt 0)



Ok.. I made a Form for my website (Mall.TGGON.9Spot.Net/Request.php)

Everything works great except.. I can't get the Form to get sent to my E-Mail..

My friend said to just Upload the FormMail.pl to the Cgi-Bin and then enter this code to the form:

<input type="hidden" name="recipient" value="Mall@TGGON.9Spot.Net">

I did everything I could think of.. But now im searching for help because I have no clue what to do.. haha

Please Help Thanks :P

MichaelBluejay

12:12 am on Apr 26, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Yes, but what is the ACTION on your form? It sounds like it should be:

<FORM ACTION="/Cgi-Bin/FormMail.pl" METHOD=POST>

If you didn't tell your form that that's where the script to send the mail is, then your form will have no idea what to do when the user clicks the Submit button.

Note that it's case sensitive, so if your cgi-bin directory is really "cgi-bin" and not "Cgi-Bin" then the code above won't work, until you make it lower case. Some for the name of the FormMail.pl (formmail.pl?) file.

If that doesn't work, check with your webhost. Many of them have FormMail scripts built in. I use Dreamhost.com and all I have to do is put

[formmail.dreamhost.com...]

into my Form action.

You have another problem: Your email address is plainly visible to spambots which will visit your page and add that address to their spam lists. A way around this that stops 99% of spambots is to hide the address with JavaScript:

<SCRIPT language=JavaScript>document.write('<INPUT type="hidden" name="recipient" value="Mail@'); document.write('TGGON.9Spot.Net.">')</SCRIPT>

It doesn't stop 100% of spambots, and it doesn't work for the <1% of people who have JavaScript turned off, but the alternative is more spam. The web isn't perfect. :(