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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.