Hi from freezing cold -2° York UK,
http://www.website-project-manager.co.uk/test-form.html is a web form using php. I’m a noob with php forms but i understand they can be hacked easily, what can i do to prevent
attacks?
Thanks for your message!
<?php
$userName = $_POST['myName'];
$userEmail = $_POST['myEmail'];
$userMessage = $_POST['myMessage'];
$to = "me@example.com";
$subject = "Email from my website";
$body = "Information Submitted:";
$headers = 'From: Enquiry Project Manager <website-project-manager.co.uk/>' . "\r\n" .
'Reply-To: me@example.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
$body .= "\r\n Name: " . $userName;
$body .= "\r\n Email: " . $userEmail;
$body .= "\r\n Message: " . $userMessage;
mail($to, $subject, $body, $headers);
?>
Thanks in advance,
David