<form name="form" method="post" action="emailscript.php">
<table cellspacing="5" cellpadding="5" border="0">
<tr>
<td>
<strong> Name: </strong>
</td>
<td>
<input type="text" name="name" size="35" />
</td>
</tr>
<tr>
<td>
<strong> Email Address: </strong>
</td>
<td>
<input type="text" name="email" size="35" />
</td>
</tr>
<tr>
<td>
<strong> Subject: </strong>
</td>
<td>
<input type="text" name="subject" size="35" />
</td>
</tr>
<tr>
<td>
<strong> Question: </strong>
</td>
<td>
<textarea name="question" cols="27" rows="4" ></textarea>
</td>
</tr>
<tr>
<td align="center"><div align="right">
<input name="reset" type="reset" value=" Reset Form " />
</div>
</td>
<td align="center"><div align="left">
<input name="submit" type="submit" value=" Submit Form " />
</div>
</td>
</tr>
</table>
</form>
<?php
$to = "[email protected]";
$subject = $_REQUEST['subject'];
$email = $_REQUEST['email'];
$name = $_REQUEST['name'];
$question = $_REQUEST['question'];
$message = $question;
$headers = "From: $email\n";
$sent = mail($to, $subject, $message, $headers) ;
if($sent) {
header ( "Location: index.php?id=emailsuccess" ) ;
}
else {
header ( "Location: index.php?id=emailfail" ) ;
}
?>
<?php
$email = $_REQUEST['email'];
$headers = "From: $email\n";
$sent = mail($to, $subject, $message, $headers);
?>
adelburn said:Am I right in thinking an input validater needs to be added i.e spamcheck