teng84 Posted August 27, 2007 Share Posted August 27, 2007 im sorry but i dont get you Link to comment https://forums.phpfreaks.com/topic/66802-need-help-with-come-code/page/2/#findComment-335008 Share on other sites More sharing options...
evanscnce Posted August 27, 2007 Author Share Posted August 27, 2007 I want a default to load by default (unless another link is chosen) And, if a link is chosen that isn't valid, I want an error page to pop up. Link to comment https://forums.phpfreaks.com/topic/66802-need-help-with-come-code/page/2/#findComment-335009 Share on other sites More sharing options...
teng84 Posted August 27, 2007 Share Posted August 27, 2007 you have the default so i dont get this I want a default to load by default (unless another link is chosen) but for your pop up have this <?php $pages = array("edit.html","delete.html","home.php"); if(in_array($_GET['page'],$pages)){ include($_GET['page']); } else{ echo '<cript type ="jascript"> alert ("mali page not found"); </script>'; include("default.html"); } ?> there might be an error as you can see im not good in typing Link to comment https://forums.phpfreaks.com/topic/66802-need-help-with-come-code/page/2/#findComment-335011 Share on other sites More sharing options...
evanscnce Posted August 27, 2007 Author Share Posted August 27, 2007 I have this: <?php $pages = array("main","test","weewoo"); if(in_array($_GET['page'],$pages)){ include($_GET['page']); } else{ include("error.html"); } ?> Problem is, when it loads index.php the first time error.html comes up. I want it to show main.html and only show error.html if something goes wrong. Link to comment https://forums.phpfreaks.com/topic/66802-need-help-with-come-code/page/2/#findComment-335017 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.