Log in

View Full Version : form handler problem



Colin-Roberts
03-09-2006, 12:47 AM
Error is:

Parse error: syntax error, unexpected $end in /home/colin/public_html/mail.php on line 22


<?PHP
if ($_SERVER['REQUEST_METHOD'] != 'GET'){
$habboname = $_POST['habboname'];
$email = $_POST['email'];
$message = $_POST['message'];

$messig = "

Name: $habboname
\n
Email: $email
\n
Message: $message
\n
Ip: $ip

";

$subject = $name;
mail("email goes here its just removed.", $subject, $messig);
Header("Location: www.colin-roberts.net");
?>

Thanx + Rep

Mentor
03-09-2006, 12:56 AM
well for one you forgot to close you if with a } which probably belongs just before the header redirect.

Yeah
03-09-2006, 09:54 AM
Add an } to the end of the script before the ?>

Edit:



<?PHP
if ($_SERVER['REQUEST_METHOD'] != 'GET'){
$habboname = $_POST['habboname'];
$email = $_POST['email'];
$message = $_POST['message'];

$messig = "

Name: $habboname
\n
Email: $email
\n
Message: $message
\n
Ip: $ip

";

$subject = $name;
mail("email goes here its just removed.", $subject, $messig);
Header("Location: www.colin-roberts.net");

}

?>

:Blob
03-09-2006, 09:57 AM
Yep, what they said... It took for ages with one of mine scripts cos i kept changing it and forgot to add }'s and remove em..

Colin-Roberts
03-09-2006, 11:15 AM
lol stupid error :S you always look for the hard reasons and miss the stupid mistakes.

Yeah
03-09-2006, 12:33 PM
Did it work?

Colin-Roberts
03-09-2006, 12:38 PM
still not getting emails but it might be delayed :S

[Oli]
03-09-2006, 12:55 PM
still not getting emails but it might be delayed :S

system i use goes auto emails arrive directly.
www.olivierpauwels.com click contact

Want to hide these adverts? Register an account for free!