ev5unleash Posted April 23, 2009 Share Posted April 23, 2009 Hey Guys, I've been using PHP Include a lot for website navigation. Now, Ever since I've updated my PHP server the PHP code I've been using doesn't work. Could anyone rewrite it so it does? I don't have the option of downgrading at this point. <?php include('indextop.php'); if( !isset($_GET['id']) ) { $xid = 'default'; } else { $xid = strtolower($_GET['id']); } switch($xid) { case 'services': include('services.php'); break; case 'default': include('indexhome.php'); break; case 'about': include('about.php'); break; case 'teacherauth': include('pages/teacherresources/auth.php'); break; } include('indexbot.php'); ?> Thanks Link to comment https://forums.phpfreaks.com/topic/155289-solved-php-include-rewrite/ Share on other sites More sharing options...
xtopolis Posted April 23, 2009 Share Posted April 23, 2009 I don't see anything wrong with your code. What are your errors? Add ini_set('display_errors', 1);; error_reporting(E_ALL); to the top of your page and see what it says. Link to comment https://forums.phpfreaks.com/topic/155289-solved-php-include-rewrite/#findComment-817024 Share on other sites More sharing options...
ev5unleash Posted April 23, 2009 Author Share Posted April 23, 2009 I get this message Warning: include(services.php) [function.include]: failed to open stream: No such file or directory in C:\wamp\www\websites\techsupport\index.php on line 16 Warning: include() [function.include]: Failed opening 'services.php' for inclusion (include_path='.;C:\php5\pear') in C:\wamp\www\websites\techsupport\index.php on line 16 And services is right next to the index.php file. What's going wrong? Link to comment https://forums.phpfreaks.com/topic/155289-solved-php-include-rewrite/#findComment-817193 Share on other sites More sharing options...
Yesideez Posted April 23, 2009 Share Posted April 23, 2009 It's complaining that services.php cannot be found and cannot be included. Link to comment https://forums.phpfreaks.com/topic/155289-solved-php-include-rewrite/#findComment-817197 Share on other sites More sharing options...
ev5unleash Posted April 23, 2009 Author Share Posted April 23, 2009 I know that but services.php is right next to it. How is it not seeing the file? Link to comment https://forums.phpfreaks.com/topic/155289-solved-php-include-rewrite/#findComment-817199 Share on other sites More sharing options...
ev5unleash Posted April 23, 2009 Author Share Posted April 23, 2009 Ahh, It wasn't a code problem. When I updated, the new update disabled some file php extension. Thanks, Anyway. Link to comment https://forums.phpfreaks.com/topic/155289-solved-php-include-rewrite/#findComment-817203 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.