clown[NOR] Posted May 31, 2007 Share Posted May 31, 2007 for some awsome reason this just wont work... but I just can't figure out the reason why... <?php $include = "hjem.php"; $vis = $_GET['vis']; if (isset($vis)) { $cs = explode("/", $vis); if (!empty($cs[1])) { $include = str_replace("/", "", $vis); } else { $include = "$vis.php"; } } if (!file_exists($include)) { $include = "missing.php"; } require_once($include); ?> Notice: Undefined index: vis in /web/sirkulus/beta/index.php on line 56 Thanks In Advance - Clown Quote Link to comment https://forums.phpfreaks.com/topic/53733-just-cant-figure-this-one-out-please-help-me-out/ Share on other sites More sharing options...
trq Posted May 31, 2007 Share Posted May 31, 2007 this just wont work What does that meen? Quote Link to comment https://forums.phpfreaks.com/topic/53733-just-cant-figure-this-one-out-please-help-me-out/#findComment-265556 Share on other sites More sharing options...
per1os Posted May 31, 2007 Share Posted May 31, 2007 <?php $include = "hjem.php"; if (isset($_GET['vis'])) { $vis = $_GET['vis']; $cs = explode("/", $vis); if (!empty($cs[1])) { $include = str_replace("/", "", $vis); } else { $include = "$vis.php"; } } if (!file_exists($include)) { $include = "missing.php"; } require_once($include); ?> It is the $_GET you have to check for isset as that is the array with the "unknown" index. Quote Link to comment https://forums.phpfreaks.com/topic/53733-just-cant-figure-this-one-out-please-help-me-out/#findComment-265558 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.