Click to See Complete Forum and Search --> : whats up with this mail script


roondog
05-23-2007, 05:13 PM
<?php
if(isset($_POST['submit'])) {

$to = "roondog@roondogid.co.uk";
$subject = "Player of year do";
$name_field = $_POST['name'];
$starter = $_POST['starter'];
$main = $_POST['main'];
$dessert = $_POST['dessert'];
$player = $_POST['poy'];
$noeat = $_POST['noeat'];

$body = "From: $name_field\n My meal choice is:\n $starter\n $main\n $dessert\n My choice for player of the year is $player\n $noeat ;

echo 'cheers';

mail($to, $subject, $body);

}
else
{
echo 'wrong page';
}
?>


I'm getting an error on line 24 which is ?> how can that be an error.

NogDog
05-23-2007, 05:43 PM
You never closed the quote on the line that begins $body = .

roondog
05-24-2007, 03:55 AM
Thanks, I knew it was something stupid like that.

php_hazard_01
05-24-2007, 05:38 AM
do u use notepad?...the editor should have highlighted the error, like above...

roondog
05-24-2007, 05:57 AM
I was in a bit of a rush so just put it in my host's editor. It was late so I was tired not really concentrating and knew the good people here would help.

php_hazard_01
05-24-2007, 05:59 AM
oh?...:)