Soldato
- Joined
- 30 Nov 2005
- Posts
- 3,084
- Location
- London
How safe is the following code?
Is it E-Mail injection proof?
What would I need to do to increase security?
I've heard of header hijacking and using the form to spam other e-mail addresses by inserting them into the header.
Is it E-Mail injection proof?
What would I need to do to increase security?
I've heard of header hijacking and using the form to spam other e-mail addresses by inserting them into the header.
PHP:
$email = $_POST['email'] ;
$to = "[email protected]";
$subject = "FORM Name";
$message = "The contents of email";
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n";
$headers .= "From: $email" . "\r\n" .
"CC: $email";
mail($to,$subject,$message,$headers);
header("Location:thankyou.php");
Last edited: