I have a basic contact form submitted using PHP. When it is submitted I receive an email however it does not display the information input into the field. That information is however sent. It displayed in the address bar of the browser e.g.
../contact.phpurl=antispam&name=dfsaa&number=fdfd&email=fdsafds%40fds.com&message=Please+contact+me+regarding+this
Front:
<form action="contact.php">
<input class="form-control" id="name" name="name" placeholder="Name" type="text" required>
<input class="form-control" id="number" name="number" placeholder="Contact Number" type="text" required>
<input class="form-control" id="email" name="email" placeholder="Email" type="email" required>
<textarea class="form-control" id="message" name="message" placeholder="Message" rows="5">Please contact me regarding this...</textarea><br>
<button class="btn btn-default pull-right" type="submit">Send</button>
</form>
PHP:
<?php
$name = @trim(stripslashes($_POST["name"]));
$email = @trim(stripslashes($_POST["email"]));
$number = @trim(stripslashes($_POST["number"]));
$message = @trim(stripslashes($_POST["message"]));
$email_from = $email;
$email_to = "sarah@blockcpm.com";
$body = "Name: " . $name . "\n\n" . "Email: " . $email . "\n\n" . "Number: " . $number . "\n\n" . "\n\n" . "Message: " . $message;
$success = @mail($email_to, $body, "Name: " . $name . "\n\n" . "Email: " . $email . "\n\n" . "Number: " . $number . "\n\n" . "Message: " . $message);
?>
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<script>
alert("Thank you for contacting us. A member of our team will be in touch as soon as possible.");
</script>
<meta HTTP-EQUIV="REFRESH" content="0; url= index.html">
</head>
The contact form works perfectly on another site... This one is on a godaddy site that i didnt create, i'm just ammending.
The email that i receive has all of the field titles but none of the input info.
Any ideas why?