StirCrazy Posted October 3, 2007 Share Posted October 3, 2007 I know this is really simple but have brain freeze. How do you include a page but include error.php (or any error file) if the file doesn't happen to exist.... for example include($page . '.php') //if page doesn't exist then... include ('error.php') Quote Link to comment https://forums.phpfreaks.com/topic/71722-solved-include-error-handling/ Share on other sites More sharing options...
marcus Posted October 3, 2007 Share Posted October 3, 2007 if(file_exists($page . ".php")){ include $page . ".php"; }else { include "error.php"; } Quote Link to comment https://forums.phpfreaks.com/topic/71722-solved-include-error-handling/#findComment-361137 Share on other sites More sharing options...
StirCrazy Posted October 3, 2007 Author Share Posted October 3, 2007 Thanks for the ultra fast reply mgallforever Quote Link to comment https://forums.phpfreaks.com/topic/71722-solved-include-error-handling/#findComment-361147 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.