XeroXer Posted July 29, 2006 Share Posted July 29, 2006 Hello again.Back with another problem.I want to make my guestbook into only one file.Therefore I want to link inside the own file.So I took from a tutorial this code:(part1)[code]<a href="index.php">default</a><a href="index.php?id=1">id 1</a><a href="index.php?id=2">id 2</a><a href="index.php?id=3">id 3</a>[/code](part2)[code]<?phpswitch($id) { case 1: echo "Number 1"; break; case 2: echo "Number 2"; break; case 3: echo "Number 3"; break; default: echo "No number between 1 and 3";}?>[/code]They said it should work on the site.But regardless of what link I press the result always ends up with the default.So is there another way this should be done.I just need to get my guestbook into one file. :-)Please help... ??? Link to comment https://forums.phpfreaks.com/topic/15947-linking-inside-own-file/ Share on other sites More sharing options...
AndyB Posted July 29, 2006 Share Posted July 29, 2006 Try a slight change ... switch($_GET['id')) { Link to comment https://forums.phpfreaks.com/topic/15947-linking-inside-own-file/#findComment-65501 Share on other sites More sharing options...
XeroXer Posted July 29, 2006 Author Share Posted July 29, 2006 Easier than I thoughtThanks a lot...Though it should be $_GET['id'] and not $_GET['id')... :-) Link to comment https://forums.phpfreaks.com/topic/15947-linking-inside-own-file/#findComment-65503 Share on other sites More sharing options...
AndyB Posted July 29, 2006 Share Posted July 29, 2006 too many thumbs, not enough coffee!!Glad you caught the typo and solved the problem. Link to comment https://forums.phpfreaks.com/topic/15947-linking-inside-own-file/#findComment-65510 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.