GetDotted Domains

Viewing Thread:
"Rusty PHP? Little help please"

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.

Mon 13/09/04 at 22:33
Regular
"l33t cs50r"
Posts: 2,956
Being totally stupid here, but someting wrong and I still can't see what:

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



















}

?>
Tue 14/09/04 at 09:11
Regular
"l33t cs50r"
Posts: 2,956
Nimco wrote:
> Change it to:
>
> mail("[email protected]", "Enquiry from
> website", $message; "From:S&N Taxi Web Enquiry");

Cheers, I'll try that later today
Mon 13/09/04 at 23:21
Regular
"NULL"
Posts: 1,384
Change it to:

mail("[email protected]", "Enquiry from website", $message; "From:S&N Taxi Web Enquiry");
Mon 13/09/04 at 23:20
Regular
"l33t cs50r"
Posts: 2,956
Nimco wrote:
> 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);
Mon 13/09/04 at 23:14
Regular
"NULL"
Posts: 1,384
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?
Mon 13/09/04 at 23:08
Regular
"l33t cs50r"
Posts: 2,956
Nimco wrote:
> 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.
Mon 13/09/04 at 23:04
Regular
"NULL"
Posts: 1,384
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");
Mon 13/09/04 at 23:01
Regular
"l33t cs50r"
Posts: 2,956
Just out of interest, the from field in the email it sends reads: "World wide web Owner" How would I change thet to read "S&N Taxi Web Enquiry"?
Mon 13/09/04 at 22:55
Regular
"NULL"
Posts: 1,384
Lol, I'm quite proud I picked that up...
Mon 13/09/04 at 22:53
Regular
"l33t cs50r"
Posts: 2,956
Nimco wrote:
> 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.
Mon 13/09/04 at 22:48
Regular
"NULL"
Posts: 1,384
That's cos there was more code that Alan didn't care to give us....

Freeola & GetDotted are rated 5 Stars

Check out some of our customer reviews below:

Thanks!
Thank you for dealing with this so promptly it's nice having a service provider that offers a good service, rare to find nowadays.
Brilliant service.
Love it, love it, love it!
Christopher

View More Reviews

Need some help? Give us a call on 01376 55 60 60

Go to Support Centre

It appears you are using an old browser, as such, some parts of the Freeola and Getdotted site will not work as intended. Using the latest version of your browser, or another browser such as Google Chrome, Mozilla Firefox, or Opera will provide a better, safer browsing experience for you.