Mail sends only some data

Mail is only returning email and phone number. Text1 and Text2 do not come through. I have used First Name and last name in the collection and send but still the first 2 fields do not show in the send mail. Here is the code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>Untitled 1</title>
</head>

<body>
<?php
$to= '[email protected]'; 
$subject='Registration';

$Var1=$_Post['Text1'];
$Var2=$_Post['Text2'];
$email=$_Post['Email'];
$phone=$_Post['Phone'];
$message= "FirstName   ". $Var1 .  "\r\n"  ."LastName  ". $Var2 .   "\r\n"   .  "Email   ". $Email .   "\r\n"   .  "Phone   ". $Phone;

Mail($to,$subject,$message);
Echo  'Thanks for registering. See You Soon!';
?>

</body>

</html>

None of these are correct. It’s $_POST not $_Post, and name your variables appropriately so that they actually make sense. $Var1 and Text2 make zero sense to what they should be.

Also it’s unclear why you even copy the values to other variables, i would recommend to use sprintf with a list of POST parameters, for readability.

Sponsor our Newsletter | Privacy Policy | Terms of Service