Jump to content

Switch Statement Help. GoDaddy or me?


shazman

Recommended Posts

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?

Link to comment
https://forums.phpfreaks.com/topic/186414-switch-statement-help-godaddy-or-me/
Share on other sites

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.