FUNKAM35 Posted June 25, 2008 Share Posted June 25, 2008 Please help - I am stuck. Have got switch to work but cant get the link to work every time I move the </a> it goes blank how can I make the switch a link as well code below: echo "</p><a href=\"animals.php?animal=$animal\" >$animal</a>\n";switch ($animal){ case "Cat": echo" Dog"; break; case "Pig": echo" Test"; break; } Quote Link to comment https://forums.phpfreaks.com/topic/111850-link-and-switch/ Share on other sites More sharing options...
ober Posted June 25, 2008 Share Posted June 25, 2008 I'm not clear on what you're trying to do or the error that is happening. Can you clarify? Quote Link to comment https://forums.phpfreaks.com/topic/111850-link-and-switch/#findComment-574208 Share on other sites More sharing options...
FUNKAM35 Posted June 26, 2008 Author Share Posted June 26, 2008 I want the switched text to before the end of the link but when I try this the page is just blank it doesnt work Quote Link to comment https://forums.phpfreaks.com/topic/111850-link-and-switch/#findComment-574877 Share on other sites More sharing options...
ocpaul20 Posted June 26, 2008 Share Posted June 26, 2008 this works how I think you want it..... but maybe I misunderstood ;-) $animal="Pig"; echo '</p><a href="animals.php?animal='.$animal.'">'; switch ($animal){ case "Cat": echo" Dog"; break; case "Pig": echo" Test"; break; } echo "</a>\n"; Quote Link to comment https://forums.phpfreaks.com/topic/111850-link-and-switch/#findComment-574883 Share on other sites More sharing options...
FUNKAM35 Posted June 26, 2008 Author Share Posted June 26, 2008 THANK YOU, didn't exactly work but you pointed me in right direction and was able to get it to work! Quote Link to comment https://forums.phpfreaks.com/topic/111850-link-and-switch/#findComment-574946 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.