954,587 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

PHP email problem

Hello, Im trying to send an email which will send information from a enquiry form. but everytime i fill in the details and press send this error comes up:

Parse error: parse error, unexpected T_VARIABLE on line 5
have i done this wrong?

<?php

$to = "[email="thomashumphrey@hotmail.com"]thomashumphrey@hotmail.com[/email]";
$re = "Enquiry Form";
$msg = "Surname: " $surname,
"Firstname: " $first_name,
"Address: " $address,
"Country: " $country,
"Phone: " $phone_home,
"Fax: " $fax,
"E-mail: " $email,
"Hectares: "$hectares,
"Tonnage: "$tonnage,
"Specific model: "$specific;

mail($to,$re,$msg);

?>

tom.hum3
Newbie Poster
1 post since Apr 2004
Reputation Points: 10
Solved Threads: 0
 

You've missed out a dot between the "surname" and the $surname.

But... why not just have "Surname: $surname Firstname: $first_name" etc rather than bothering with the dots... otherwise you're wasting resources.

Roberdin
Supreme Evil Overlord
Team Colleague
282 posts since Feb 2003
Reputation Points: 63
Solved Threads: 6
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You