I have a form that is used to send somebody's email address to me in an email so that I can add them to a mailing list.
The problem is, that I keep receiving emails that have no data in them; they don't contain the email address of whoever filled out the form.
Here is the HTML for the form:
Code: Select all
<form id="myForm" name="myForm" method="post" action="http://www.eddiecole.com/joinMail.php" onsubmit="return validate_form();">
<input style="width:200px;" id="emailbox" type="text" name="text_email" value="Type Email Address Here" onfocus="clear_textbox()"/>
<input type="submit" value="Join Mailing List" />
</form>Code: Select all
<?php
$emailContents = "This person has requested to be added to the mailing list: \n";
$emailContents .= "<" . htmlspecialchars($_POST["text_email"]) . ">";
if ( htmlspecialchars($_POST["text_email"]) == "" )
{
$emailContents .= "\n\nThe text field was empty." ;
}
mail("admin@eddiecole.com","MAILING LIST ADDITION", $emailContents);
echo ("<center>Thankyou. Your email address has been registered.</center>");
?>This person has requested to be added to the mailing list:
<jsmith@email.com>
But instead the look like this:
This person has requested to be added to the mailing list:
<>
I have tried getting browser information using hidden input fields in the form, but the information from these fields never arrives either.
When I test the script using my own computer (and also a friend's computer with different OS and browser) the whole thing works just fine!
I am not sure where exactly the problem is here; code or something else, so I apologize if I've asked this question in the wrong place.
Thanks for any help : )