Jump to content

dynamic inclusion


kevinjo

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.