0

I'm experiencing alot of issues trying to create the $to field as a variable, PHP is reporting Parse error: syntax error, unexpected T_VARIABLE, expecting T_FUNCTION in /home/shhdcouk/public_html/PHP/class_vcard.php on line 172 and I'm not sure why.... my code is.

$send = $_POST;
$to = $send;
$subject = "Registered for xxxx";
$body="Thank you for registering your details xxxx\n\n";
$headers= "From: xxxx Web Site\r\n";

if(mail($to, $subject, $body, $headers)) {
include ("OK.htm");
}
else {
include("Error.htm");
}

Can anyone help a frustrated newcomer?

2
Contributors
2
Replies
3
Views
8 Years
Discussion Span
Last Post by Thorby68
0

I'm experiencing alot of issues trying to create the $to field as a variable, PHP is reporting Parse error: syntax error, unexpected T_VARIABLE, expecting T_FUNCTION in /home/shhdcouk/public_html/PHP/class_vcard.php on line 172 and I'm not sure why.... my code is.

$send = $_POST;
$to = $send;
$subject = "Registered for xxxx";
$body="Thank you for registering your details xxxx\n\n";
$headers= "From: xxxx Web Site\r\n";

if(mail($to, $subject, $body, $headers)) {
include ("OK.htm");
}
else {
include("Error.htm");
}

Can anyone help a frustrated newcomer?

I am Check your code and Fid a Problem in Your Query.

Please Change Your Query with Below Code: $to = $send; If u are POST your $send Variable then use: $to = $_POST['$send']; Try the above Solution may be your Problem is solved.

0

Mnay thanks, but I get the same error "Parse error: syntax error, unexpected T_VARIABLE, expecting T_FUNCTION in /home/shhdcouk/public_html/PHP/class_vcard.php "

Is there any other way of generating $to as a variable (i.e. I want to use the data submitted by the form "$_POST[email1]"

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.