Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Aug 2006
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts

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

    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");

    ?>

  • #2
    Senior Coder chump2877's Avatar
    Join Date
    Dec 2004
    Location
    the U.S. of freakin' A.
    Posts
    2,859
    Thanks
    22
    Thanked 157 Times in 148 Posts
    PHP Code:
    <?
        
    $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");
    }
         
    ?>
    Last edited by chump2877; 08-30-2006 at 03:03 PM.
    Regards, R.J.

    ---------------------------------------------------------

    Help spread the word! Like my YouTube-to-Mp3 Conversion Script on Facebook !! :-)
    [Related videos and tutorials are also available at my YouTube channel and on Dailymotion]
    Get free updates about new software version releases, features, and bug fixes!
    ♪♪ …Need Web Hosting For My YouTube-To-Mp3 Conversion Software? Check Here !!… ♪♪

  • #3
    Regular Coder
    Join Date
    Aug 2006
    Location
    UK, London, Dartford
    Posts
    221
    Thanks
    3
    Thanked 14 Times in 14 Posts
    Should be:
    PHP Code:
    <?
    $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

  • #4
    New Coder
    Join Date
    Aug 2006
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thanks very much guys. much appreciated.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •