Results 1 to 3 of 3

Thread: [RESOLVED] error on simple switch statement

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Oct 2007
    Location
    Godzone, oops Oz
    Posts
    355

    Resolved [RESOLVED] error on simple switch statement

    Parse error: syntax error, unexpected T_DEFAULT
    Code:
    	// Script flow
    	
    	switch($mod) {
    		
    		case 'doadd':
    		   die('executed doadd code');
    		   break;
    		case default:
    			addgroup();
    			break;
    			
    	}
    error occurs around the "case defualt" line. Can't see anything wrong.

  2. #2
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: error on simple switch statement

    Just 'default', not 'case default'.

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Oct 2007
    Location
    Godzone, oops Oz
    Posts
    355

    Re: error on simple switch statement

    Quote Originally Posted by penagate
    Just 'default', not 'case default'.
    Bangs head on desk.

    Thanks dude will try this out later in the morning when I get the chance. Sunny Adelaide huh Hosing down over here in Sydney at the moment.

    That fixed that one up. Not the world's leading expert on php so expect a torrent of questions as have an old software package that I'm rewriting to utilise modern web design and stuff.
    Last edited by KiwiDexter; Jan 31st, 2008 at 08:14 PM.

Posting Permissions

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



Click Here to Expand Forum to Full Width