Forum Moderators: coopster
Here is the code:
<?
//Declare the variables
$recipient = "someone@example.com";
$subject = "User Registration Details";
$message = "all $ variables here ";
$subject=$_POST['subject'];
//Contents of form - all variables correspond to
//variables in my form
$name=$_POST['name'];
$email=$_POST['email'];
$country=$_POST['country'];
$etc=$_POST['etc'];
$etc=$_POST['etc'];
$etc=$_POST['etc'];
$etc=$_POST['etc'];
$etc=$_POST['etc'];
$etc=$_POST['etc'];
$etc=$_POST['etc'];
$etc=$_POST['etc'];
$etc=$_POST['etc'];
//mail() function sends the mail
mail($recipient,$subject,$message,$email);
//This line sends to thankyou page when finished
header("Location: http://www.example.com/member_reg_success.htm");
?>
Error message I get is this:
Parse error: parse error, unexpected T_LNUMBER, expecting T_VARIABLE or '$' in /home/example/public_html/member_reg.php on line 25
If anyone can help I'll be a very happy, headache free boy.
<?
//mail script here
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Thanks</title>
</head>
<body>
<p>Thank you. You should be receiving an email shortly...</p>
</body>
</html>
One less piece of coding to track bugs in :)
WBF
Going back to your original post. Do not put $_POST['fieldname'] in double quotes or you will get an error message.
For example
$message = "The message is: $_POST['fieldname']\n";
will not work and will result in an error message, however
$message = "The message is:" . $_POST['fieldname'] . "\n";
will work fine.
$message = <<<END
The message is $_POST['fieldname']\n
END;
should also work (I think).