Trouble with my Mail Form / form mail
Posted: Wed Jan 30, 2008 4:31 am
Hi
I am trying to modify a php mail form. I have added in a new field called 'telephone' but now the text I type in the text box isn't displaying in the email that I receive.
Could someone have a look and see what I have done wrong please?
Thanks
mail.php:
The HTML form:
I am trying to modify a php mail form. I have added in a new field called 'telephone' but now the text I type in the text box isn't displaying in the email that I receive.
Could someone have a look and see what I have done wrong please?
Thanks
mail.php:
Code: Select all
<?php
@extract($_POST);
$name = stripslashes($name);
$email = stripslashes($email);
$subject = stripslashes(Reflexology);
$telephone = stripslashes($telephone);
$text = stripslashes($text);
$text = $telephone;
$text = $text;
$text .= "\n\n IP Address: " . $_SERVER['REMOTE_ADDR'];
if ($_SERVER['HTTP_X_FORWARDED_FOR'])
{
$text .= " or Proxy Reports: " . $_SERVER['HTTP_X_FORWARDED_FOR'];
}
$text .= "\n\nUser Agent: " . stripslashes($_SERVER['HTTP_USER_AGENT']);
mail('X@gmail.com', $subject,$text,"From: $name <$email>");
header("location:mailsent.htm");
?>Code: Select all
<form action="mail.php" method="post">
<div align="center">
<div align="left"><span >Your name: </span></div>
<div align="left">
<input name="name" type="text" class="text-box" size="47%" maxlength="50">
</div>
<div align="left"><span>Your e-mail address: </span></div>
<div align="left">
<input name="email" type="text" class="text-box" size="47%" maxlength="50">
</div>
<div align="left"><span >Your telephone number: </span></div>
<div align="left">
<input name="telephone" type="text" class="text-box" size="47%" maxlength="50">
</div>
<div align="left"><span>Your message:</span></div>
<div align="left">
<textarea name="text" cols="35%" rows="6" class="text-box" id="text" ></textarea>
</div>
<div align="left">
<input name="submit" type="submit" class="button" onClick="return document.MM_returnValue" value="send">
<input name="Reset" type="reset" class="button" value="reset">
</div>
</div>
</form>