shazman Posted December 27, 2009 Share Posted December 27, 2009 I am having problems with switch statements on my site. I have a test page that I have created but can't get it to work. Here is the script I have on the page. <?php switch($a) { case 1: print 'One'; break; case 2: print 'Two'; break; case 3: print 'Three'; break; default: print 'Default'; break; } ?> I ran this script on a page that is hosted by GoDaddy and it only shows the default. I ran the exact same thing on another page hosted by 1&1 and it works flawlessly. I've searched GoDaddy's site for help and even contacted their customer support a couple times without ever receiving a reply. Is there something special with GoDaddy or is my script somehow wrong? Is there anybody out there with the same problem? Quote Link to comment https://forums.phpfreaks.com/topic/186414-switch-statement-help-godaddy-or-me/ Share on other sites More sharing options...
optikalefx Posted December 27, 2009 Share Posted December 27, 2009 Call goDaddy... This happens all the time with them Quote Link to comment https://forums.phpfreaks.com/topic/186414-switch-statement-help-godaddy-or-me/#findComment-984399 Share on other sites More sharing options...
oni-kun Posted December 27, 2009 Share Posted December 27, 2009 You're not defining $a, Was that your problem? It'd always go to default. If not so, than it is most likely a server configuration issue, I've not heard of something that would break a switch statement, ALTHOUGH I would not be surprised if GoDaddy would run into, Such an issue.. Quote Link to comment https://forums.phpfreaks.com/topic/186414-switch-statement-help-godaddy-or-me/#findComment-984416 Share on other sites More sharing options...
laffin Posted December 27, 2009 Share Posted December 27, 2009 Well sounds like godaddy is doing something right. What ya see there is an example of bad programming practice Register Globals Which takes uri arguments and makes em a global variable in the script. Quote Link to comment https://forums.phpfreaks.com/topic/186414-switch-statement-help-godaddy-or-me/#findComment-984424 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.