Jump to content

Include problems..


rik72

Recommended Posts

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.