PDA

View Full Version : PHP problems!



Jiggles
17-10-2006, 04:05 PM
Im having a problem in the PHP in my web form

Heres the error:


Parse error: syntax error, unexpected ',' in /home/www/cb-entertainments.co.uk/booking.php on line 8

Hmm iv tryed everythink that I can think of :teeth:


Thanks in advanced.

Sam
17-10-2006, 04:09 PM
Urm..
Look in the code.. look at line 8.. and where the unexpected , is.. take it out.

Jiggles
17-10-2006, 04:14 PM
Urm..
Look in the code.. look at line 8.. and where the unexpected , is.. take it out.

I dont know where it is!!
the code ( the numbers are the lines)


<?
1) $SendFrom = "Form Feedback <[email protected]>";
2)$SendTo = "[email protected]";
3)$SubjectLine = "Quote Submission";
4)$ThanksURL = "booked.html";
5)$Divider = "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~";
6)$MsgBody = @gethostbyaddr($_SERVER["REMOTE_ADDR"]) . "\n$Divider\n"; foreach ($_POST as $Field=>$Value) $MsgBody .= "$Field: 7)$Value\n"; $MsgBody .= "$Divider\n" . $_SERVER["HTTP_USER_AGENT"] . "\n"; $MsgBody = htmlspecialchars($MsgBody);
8)($SendTo, $SubjectLine, $MsgBody, "From: $SendFrom"); header("Location: $ThanksURL");
?>

Danno13
17-10-2006, 04:59 PM
Line 8 is wrong.. you're missing the "mail" command that takes all those parameters in the brackets.

Try this -

mail($SendTo, $SubjectLine, $MsgBody, "From: $SendFrom");

Jiggles
17-10-2006, 05:02 PM
ok ill try it thanks

DMX Will
17-10-2006, 10:31 PM
Might also be worth moving the 'header("Location:'....etc down a line to form a new line, some servers are picky

Sam
17-10-2006, 10:31 PM
hes fixed it apparently

Jiggles
20-10-2006, 07:24 PM
Here we go again!

Prob: Parse error: syntax error, unexpected '<' in /home/www/cb-entertainments.co.uk/booking.php on line 5



<?
$SendFrom = "Form Feedback <[email protected]>"; $SendTo = "[email protected]"; $SubjectLine = "Quote Submission"; $ThanksURL = "thankyou.html";
$Divider = "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~";
$MsgBody = @gethostbyaddr($_SERVER["REMOTE_ADDR"]) . "\n$Divider\n"; foreach ($_POST as $Field=>$Value) $MsgBody .= "$Field: $Value\n"; $MsgBody .= "$Divider\n" . $_SERVER["HTTP_USER_AGENT"] . "\n"; $MsgBody = htmlspecialchars($MsgBody);
mail($SendTo, $SubjectLine, $MsgBody, "From: $SendFrom"); header("Location: $ThanksURL"); <?php
?>

Danno13
20-10-2006, 09:20 PM
mail($SendTo, $SubjectLine, $MsgBody, "From: $SendFrom"); header("Location: $ThanksURL"); <?php

Get rid of the bold bit... and the opening <? should really be <?php, may not make a difference but some servers are more fusy than others.

Jiggles
20-10-2006, 09:45 PM
ok thanks again Danno


Oh great it wont send me the email iv been waiting on 10 of them now for 3 days!!!