kevinjo Posted May 7, 2008 Share Posted May 7, 2008 okay so Im currently using dynamic inclusion for my site however, everything works fine except for the index page, Warning: include() [function.include]: Failed opening '' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/kevinjo/public_html/colourfierce/index.php on line 83 that comes up on my index, and this is all the php, I have on my site index <?php $page = $_GET['page']; $pages = array('page1', 'page2', 'page3'); if (!empty($page)) { if(in_array($page,$pages)) { $page .= '.php'; include($page); } else { echo ''; } } else { include('page1.php'); } ?> <?php $url = ''; if (!empty($_GET['category'])) { $url .= $_GET['category'] . '/'; } if (!empty($_GET['page'])) { $url .= $_GET['page'] . '.php'; } include $url; ?> now this is what I have on line 83 include $url; . I tried to figure it out but with no avail, any help? thanks in advance :] Link to comment https://forums.phpfreaks.com/topic/104491-dynamic-inclusion/ Share on other sites More sharing options...
DarkWater Posted May 7, 2008 Share Posted May 7, 2008 You never do any checking to make sure that $url actually has a value before the include line. =) if ($url != '') { include $url; } Link to comment https://forums.phpfreaks.com/topic/104491-dynamic-inclusion/#findComment-534911 Share on other sites More sharing options...
tronicsmasta Posted May 7, 2008 Share Posted May 7, 2008 include ('$url'); Link to comment https://forums.phpfreaks.com/topic/104491-dynamic-inclusion/#findComment-534913 Share on other sites More sharing options...
DarkWater Posted May 7, 2008 Share Posted May 7, 2008 No, Tronics. It won't be parsed because it's in single quotes....And that's not the issue. Read my post. Link to comment https://forums.phpfreaks.com/topic/104491-dynamic-inclusion/#findComment-534917 Share on other sites More sharing options...
kevinjo Posted May 7, 2008 Author Share Posted May 7, 2008 thank you so much, this site is awesome:] , dark water was correct :] Link to comment https://forums.phpfreaks.com/topic/104491-dynamic-inclusion/#findComment-534918 Share on other sites More sharing options...
tronicsmasta Posted May 7, 2008 Share Posted May 7, 2008 You and I posted at the same time Sry for the confusion... I try lol Link to comment https://forums.phpfreaks.com/topic/104491-dynamic-inclusion/#findComment-534936 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.