jeudi 16 juin 2016

php works but shows no content

I was working on a form and i had to use php to send the data through email. I am really new to coding. I just started working with php. My form works i even receive emails through it but the php page shows up blank. I tried using echo and error reporting but nothing shows up no html code shows up either. Its probably a newbie mistake. My php code:

    <?php
$name = $_POST['fullName'];
$email_address = $_POST['email'];
$phone = $_POST['phoneNumber'];
$gender = $_POST['gender'];
$country = $_POST['country'];
$age = $_POST['age'];


$headers = "From: noreply@domainname.com";
$to = 'someone@example.com'; 
$email_subject = "Website Contact Form:  $name";
$email_body = "You have received a new message from your website contact form.nn"."Here are the details:nnName: $namennEmail: $email_addressnnPhone: $phonenngender: $gendernncountry: $countrynnage: $age";

mail($to,$email_subject,$email_body,$headers);
return true;

echo "thank you"
?>

Aucun commentaire:

Enregistrer un commentaire