redfire Posted October 29, 2006 Share Posted October 29, 2006 Okay I'm currently working on a new template, and instead of making a hole new page for every thing I'm setting it up just it just changes the one area.[code]<?php switch($_GET['id']) {default: include('home.php'); break; case 'news': include('news.php'); break; case 'forums': include('forums.php'); break; }?>[/code]and I have the links set-up like[code]<a href="index.php?id=news">News</a>[quote][/quote][/code]I have it set-up like that but it doesn't want to work :( Link to comment https://forums.phpfreaks.com/topic/25449-switch-conditionals/ Share on other sites More sharing options...
toplay Posted October 29, 2006 Share Posted October 29, 2006 It looks ok except put the "default" case as the last one.See:http://us2.php.net/manual/en/control-structures.switch.php#AEN5024 Link to comment https://forums.phpfreaks.com/topic/25449-switch-conditionals/#findComment-116138 Share on other sites More sharing options...
redfire Posted October 29, 2006 Author Share Posted October 29, 2006 fixed thanks :D Link to comment https://forums.phpfreaks.com/topic/25449-switch-conditionals/#findComment-116140 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.