html - php works but shows no content -


i working on form , had use php send data through email. new coding. started working php. form works receive emails through php page shows blank. tried using echo , error reporting nothing shows no html code shows either. newbie mistake. 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 new message website contact form.\n\n"."here details:\n\nname: $name\n\nemail: $email_address\n\nphone: $phone\n\ngender: $gender\n\ncountry: $country\n\nage: $age";  mail($to,$email_subject,$email_body,$headers); return true;  echo "thank you" ?> 

you have 2 options right now:

  1. remove return true;
  2. move echo "thank you"; before return true;

you can read more return here: http://php.net/manual/en/function.return.php

side-note: forgot semi-colon (;) after echo:

echo "thank you"; //--------------^ 

Comments

Popular posts from this blog

sequelize.js - Sequelize group by with association includes id -

android - Robolectric "INTERNET permission is required" -

java - Android raising EPERM (Operation not permitted) when attempting to send UDP packet after network connection -