My form:
[code]<form action=”mailtoenquire.php” method=”POST”>
Name: <br/><input type=”text” name=”name”/><br/>
Company: <br/><input type=”text” name=”company”/><br/>
Email: <br/><input type=”text” name=”email”/><br/>
Phone number:<br/><input type=”text” name=”telnum”/><br/>
Fax:<br/><input type=”text” name=”faxnum”><br/>
Enquiry: <br/><textarea rows=”15″ cols=”80″ name=”enquiry”/></textarea><br/>
<input type=”submit” value=”Send” id=”sendbutton”/>
</form>
My script:
[code]<?php
$name = ‘From: ‘.$REQUEST[‘name’].'<br/>’;
$company = $_REQUEST[‘company’];
$emailaddress = $_REQUEST[’email’];
$telno = ‘Telephone: ‘.$_REQUEST[‘telnum’].'<br/>’;
$faxno = ‘Fax: ‘.$_REQUEST[‘faxnum’].'<br/>’;
$enquiry = $_REQUEST[‘enquiry’];
$recepitant = ‘[email protected]’;
$header = $name.$faxno.$telno;
$subject = ‘Enquiry from: ‘.$company.”;
//if (preg_match($regexp, $email)){
mail($recepitant,$subject,$enquiry, $header);
echo ‘Mail Sent. Click <a href=”index.html”>here</a> to return.’;
/*}
else {
echo ‘Mail sending failed.’;
}*/
?>
And here is my output in an email:
From:
Fax:
Telephone:
Where did the variables go? (NOTE: I know that code is open to an email injection, I’m just dumbing it down to find the problem).