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') 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"; } 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 Link to comment https://forums.phpfreaks.com/topic/71722-solved-include-error-handling/#findComment-361147 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.