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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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