Jump to content

Switch query


FUNKAM35

Recommended Posts

From your other post, and confusing explanations i can only work out the following:

 

this code:

echo "<a href=\"animals.php?animal=$animal\">$animal</a>";
switch($animal){
case "cat":
  print 'Dog';
  break;
case "Pig":
  print 'Test';
  break;
}

 

 

looka like this?

CatDog

 

 

The only way you can get around this is by...

switch($_GET['animals']){
case 'Cat':
  $animal ='Dog';
  break;
case 'Pig':
  $animal ='Test';
  break;
}

print "<a href=\"animals.php?animal=$animal\">$animal</a>";

 

If Animal is Cat, will return:

Dog

Link to comment
https://forums.phpfreaks.com/topic/112010-switch-query/#findComment-575116
Share on other sites

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.