PDA

Click to See Complete Forum and Search --> : [RESOLVED] error on simple switch statement


KiwiDexter
Jan 31st, 2008, 01:13 AM
Parse error: syntax error, unexpected T_DEFAULT



// 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.

penagate
Jan 31st, 2008, 01:21 AM
Just 'default', not 'case default'.

KiwiDexter
Jan 31st, 2008, 05:23 PM
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 :wave: 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.