Concatenation in PHP Mail Script

Can someone just take a look at this and tell me if I did everything right in this mail script. The thing I was least sure about was the concatenation operator. I think its a . not a + but I am not sure.


<?

$Name = $_GET['name'];
$Email = $_GET['email'];
$Message = $_GET["Name ".'name'." Address".'address'." Phone".'phone'." Graduation Year".'grad'];
$Subject = "Site Response";
$Header = "From: $Name <$Email>";



$new = mail($Email, $Subject, $Message, $Header);

?>


$Message = $_GET["$name, $add, $etc"];

Can you explain a little more please?
I want it to email
"Name: (their name)
Address: (their address)
Phone: (their phone)
Graduation Year: (their grad year)"

the variables are name, address, phone, and grad


<?

$name = $_GET['name'];
$email = $_GET['email'];
$address = $_GET['address'];
$phone = $_GET['phone'];
$grad = $_GET['grad'];
$message = "Name :".$name."
";
$message .= "Address :".$address."
"
$message .= "Phone :".$phone."
";
$message .= "Graduation Year :".$grad."
"
$subject = "Site Response";
$header = "From: ".$name." <".$email.">";

mail($email, $subject, $message, $header);

?>


I think that should do it. I’m not sure if it is
or /n. Try them out. Look closely at the colour syntax and you’ll figure out the . operator :slight_smile: But look out: this will email the address you got using GET.

ok. thanks voetsjoeba

No problem :slight_smile: