rik72 Posted November 21, 2007 Share Posted November 21, 2007 Having issues with the following code, the file does exist but im getting no error messages! <?PHP if (!defined("LOAD_AS_MODULE")) { module_error("permissiondenied"); exit(); } $temp = load_template("main-content-news"); $newsbit = get_include_contents('modules/m_news/show_news.php'); function get_include_contents($filename) { if (is_file($filename)) { ob_start(); include $filename; $contents = ob_get_contents(); ob_end_clean(); return $contents; } return false; } function module_main() { $conte .= str_replace("", $newsbit, $temp); return $conte; } ?> Link to comment https://forums.phpfreaks.com/topic/78303-include-problems/ Share on other sites More sharing options...
Wes1890 Posted November 21, 2007 Share Posted November 21, 2007 ^ your getting no error message? was that a typo? if you get an error message, please post it. also, try putting the include-file in the same directory as the script and see if it works Link to comment https://forums.phpfreaks.com/topic/78303-include-problems/#findComment-396228 Share on other sites More sharing options...
premiso Posted November 21, 2007 Share Posted November 21, 2007 Make sure display_errors is turned on and error_reporting is set to E_ALL to make sure that errors are suppose to display. Also, you are not checking if get_include_contents is returning false, which it could be. A lot of unknowns I suggest trying that first. Link to comment https://forums.phpfreaks.com/topic/78303-include-problems/#findComment-396296 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.