...

View Full Version : HELP Urgent! Parse error: parse error, unexpected T_ELSEIF in /ho....



mike jongbloet
08-30-2006, 01:39 PM
Hello all,

Browsing the internet I came across this forum which looked very useful for the help I need. I'm coding a website with 2 forms on it. This is my php code from the more simple of the two.

Basically what i need it to do is take the info from the feedback form and send it to my mail. It also checks that fields ahve been filled in properly.

However, when I upload it and run it i get the error shown above (post title)

the code is below and the error is suposedly in Line 10. IO can't spot it so any help is greatly appreciated. Thanks.

<?
$name = $_REQUEST['name'] ;
$company = $_REQUEST['company'] ;
$email = $_REQUEST['email'] ;
$comments = $_REQUEST['comments'] ;

if (!isset($_REQUEST['email'])) {
header( "Location: http://www.mesh4safety.co.uk/cont_fbk.htm");

elseif (empty($email) || empty($name) || empty ($comments)) {
header( "Location: http://www.mesh4safety.co.uk/fbkerror.htm");
else {
mail( "kingcantona1999@yahoo.co.uk", "Feedback Form", $message, "From: $name");
header ("Location: http://www.mesh4safety.co.uk/fbkthankyou.htm");

?>

chump2877
08-30-2006, 02:01 PM
<?

$name = $_REQUEST['name'];
$company = $_REQUEST['company'];
$email = $_REQUEST['email'];
$comments = $_REQUEST['comments'];

if (!isset($_REQUEST['email']))
{
header("Location: http://www.mesh4safety.co.uk/cont_fbk.htm");
}
elseif (empty($email) || empty($name) || empty($comments))
{
header("Location: http://www.mesh4safety.co.uk/fbkerror.htm");
}
else
{
mail("kingcantona1999@yahoo.co.uk", "Feedback Form", $message, "From: $name");
header("Location: http://www.mesh4safety.co.uk/fbkthankyou.htm");
}

?>

Lee Stevens
08-30-2006, 02:07 PM
Should be:


<?
$name = $_REQUEST['name'] ;
$company = $_REQUEST['company'] ;
$email = $_REQUEST['email'] ;
$comments = $_REQUEST['comments'] ;

if (!isset($_REQUEST['email'])) {
header ("Location: http://www.mesh4safety.co.uk/cont_fbk.htm");

} elseif (empty($email) || empty($name) || empty ($comments)) {
header ("Location: http://www.mesh4safety.co.uk/fbkerror.htm");

} else {
mail( "kingcantona1999@yahoo.co.uk", "Feedback Form", $message, "From: $name");
header ("Location: http://www.mesh4safety.co.uk/fbkthankyou.htm");
}
?>


That should be all hope it works.

// Looks liek the man abouve beet me lol

mike jongbloet
08-31-2006, 10:07 AM
thanks very much guys. much appreciated.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum