Hi everyone i am new to php and have recently adapted a php email form and would like someone to validate it for me to make sure that it is correct.
<?php
if ($_SERVER['REQUEST_METHOD'] != 'POST'){
$me = $_SERVER['PHP_SELF'];
?>
<form name="form1" method="post"
action="<?php echo $me;?>">
<table border="0" cellspacing="0" cellpadding="2">
<tr>
<td>Name:</td>
<td><input name="Name" type="text" size="40" maxlength="40"></input></td>
</tr>
<tr>
<td>Email address:</td>
<td><input name="Email" type="text" size="40" maxlength="40"></input></td>
</tr>
<tr>
<td valign="top">Message:</td>
<td><textarea name="MsgBody" cols="40" rows="6"></textarea></td>
</tr>
<tr>
<td> </td>
<td><input type="submit" name="Submit"
value="Send"></input></td>
</tr>
</table>
</form> <?php
} else {
error_reporting(0);
$recipient = [EMAIL="'blahs@blah.com'"]'blahs@blah.com'[/EMAIL];
$from = stripslashes($_POST['Name']);
$msg = "Email address of sender: stripslashes($_POST['Email'])";
$msg = "Message from: $from\n\n".stripslashes($_POST['MsgBody']);
if (mail($recipient, $subject, $msg))
echo nl2br("<b>Message Sent:</b>
To: $recipient
Message:
$msg");
else
echo "Message failed to send";
}?>
Thanking you in anticipation
Ashjenius