The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> else error me message
Mindapolis
post Oct 31 2011, 08:03 PM
Post #1


Member
***

Group: Members
Posts: 67
Joined: 2-April 11
Member No.: 14,256



could someone help me understand this error message? The code is:
CODE


$errors=array();
    if(isset($_POST['submit'])){
    validate_input();
      else {
        display_form();    
    }
    }


the error message is:
Parse error: syntax error, unexpected T_ELSE in /home/content/a/u/n/auntievics/html/checkOut.php on line 38
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Brian Chandler
post Oct 31 2011, 10:34 PM
Post #2


Jocular coder
********

Group: Members
Posts: 2,460
Joined: 31-August 06
Member No.: 43



Yes, you have

CODE

$errors=array();
    if(isset($_POST['submit']))

    {   validate_input();

//** no closing } !!

      else {
        display_form();    
    }
    }


which is why the 'else' is unexpected. The php error messages are all wrong, because they refer to php keyword 'xyz' by the internal compiler token, which is something like T_XYZ.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Mindapolis
post Nov 1 2011, 08:21 AM
Post #3


Member
***

Group: Members
Posts: 67
Joined: 2-April 11
Member No.: 14,256



that helped. Thank you so much for the explanation of the error message
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 23rd April 2024 - 11:25 PM