Welcome to WebmasterWorld Guest from

Forum Moderators: coopster & jatar k & phranque

Message Too Old, No Replies

PHP form sends blank emails - fixes suggested not worked

php form blank email



11:48 am on Sep 22, 2009 (gmt 0)

5+ Year Member

I'm working on a form - it works except that it sends me a blank email. I have no idea what's happening and very little (none) PHP experience. Can anyone assist me with what the issue is here?

The form is:

<FORM METHOD="POST" target="_top" ACTION="/cgi-bin/formmail/FormMail.pl">
<INPUT TYPE="HIDDEN" NAME="recipient" VALUE="myemail@email.com.au">
<INPUT TYPE="hidden" NAME="subject" VALUE="Newsletter enquiry">
<input type="hidden" name="redirect" value="http://www.xxmysitexx.html">
<input type="hidden" name="missing_fields_redirect" value="http://www.xxmysitexx.html">
<input type="hidden" name="print_config" value="name,phone,e-mail">
<p><label for="name">First Name</label> <input type="text" id="name" /></p>
<p><label for="phone">Last Name</label> <input type="text" id="phone" /></p>
<p><label for="e-mail">Email</label> <input type="text" id="e-mail" /></p>
<p class="submit"></p>
<input type="submit" value="Submit" margin-left="auto" />



3:23 pm on Sep 22, 2009 (gmt 0)

10+ Year Member

Your form uses Perl and not php but anyway...

These are probably incorrect:

<input type="text" id="name" />
<input type="text" id="phone" />
<input type="text" id="e-mail" />

They should probably be:

<input type="text" id="name" name="name" />
<input type="text" id="phone" name="phone"/>
<input type="text" id="e-mail" name="email"/>

Try that and see what happens...


5:43 pm on Sep 23, 2009 (gmt 0)

WebmasterWorld Senior Member rocknbil is a WebmasterWorld Top Contributor of All Time 10+ Year Member

Welcome aboard GirlAboutTown! (What town are you about? JUST KIDDING . . . . )

Correct, and the explanation behind that is names are used to assign key/value pairs to transmit the data to the server, ids are used to manipulate the document client side via CSS, Javascript, or other technologies.

However, this generic script is well known for being abused by spammers, and is a headache waiting to happen for you, beginning with

<INPUT TYPE="HIDDEN" NAME="recipient" VALUE="myemail@email.com.au">

Although it's a hidden field, this is an appetizer for email spiders. They will read your page and find this email, drop it into a spam list. If you have access to this script, hard code the email address into the script, at the very least.


6:46 am on Sep 24, 2009 (gmt 0)

WebmasterWorld Senior Member dreamcatcher is a WebmasterWorld Top Contributor of All Time 10+ Year Member

Hi GirlAboutTown, welcome to Webmaster World. :)

I moved this thread to Perl. As previously mentioned, its not PHP.



Featured Threads

Hot Threads This Week

Hot Threads This Month