The "Freeola Customer Forum" forum, which includes Retro Game Reviews, has been archived and is now read-only. You cannot post here or create a new thread or review on this forum.
Error is: parse error, unexpected T_STRING, expecting ']' on line 29
Code:
if ($_POST)
{
$name = $_POST['name'];
$email = $_POST['telNo];
$comments = $_POST['comments']; ***THIS IS LINE 29***
$message = "Message from $name ($telNo)\n\nComments:\n\n$bodytext";
mail("[email protected]", "Enquiry from website", $message);
echo "
Thank you for your enquiry
\n";}
else
{
?>
Enquiry Form
}
?>
> Change it to:
>
> mail("[email protected]", "Enquiry from
> website", $message; "From:S&N Taxi Web Enquiry");
Cheers, I'll try that later today
mail("[email protected]", "Enquiry from website", $message; "From:S&N Taxi Web Enquiry");
> Well, on that page, the action is to resend to the current page. So
> you need to check on that page for a mail() reference. What does that
> function say?
mail("[email protected]", "Enquiry from website", $message);
> If it's in PHP, just edit the 'from' attribute of the mail() function.
> The syntax of mail() is as follows:
>
> mail ( string to, string subject, string message [, string
> additional_headers [, string additional_parameters]])
>
> To change the from attribute, you need something like:
>
> mail("[email protected]", "foo bar", "foo bar bar
> bar", "From: S&N Taxi Web Enquiry");
Being dim here. It's the sender field thats reading wrong. So currently if you send the form you get:
From: World Wide Web Owner
To: .......@.......
Subject: Enquirey from website
So it's the from I need to change.
mail ( string to, string subject, string message [, string additional_headers [, string additional_parameters]])
To change the from attribute, you need something like:
mail("[email protected]", "foo bar", "foo bar bar bar", "From: S&N Taxi Web Enquiry");
> I just copied it into DW MX and it came up with the wrong colours from
> line 28 onwards. Ran a W3C check on it and it confirmed it was an
> error at line 28. Looked at it and saw the bracket was the wrong
> colour, then noticed the missing '. It's amazing how such a small
> error has such a big effect.
>
> Just out of curiosity, why are you overriding the old safe mode
> feature of variables in arrays?
To be honest, I'm not paying to much attention to it as I'm rushing it out and have a direlack of coffee, but for what it's worth, it's this:
http://dev.digital-prozac.co.uk/sn/
So not too bothered. Was recycling some code from something I did ages ago.