I am trying to call a function printRightContent present in **root_directory/lib/common.php ** in Adcovate.php but it gives me the following error error:
PHP Fatal error: Uncaught Error: Call to undefined function printRightContent()
This is my PHP file Adcovate.php:
<?php
include 'lib/common.php';
function printResults($page, $perpage)
{
?>
<div id="right_content">
<?php
error_reporting(E_ALL);
ini_set('log_errors', 1);
ini_set('error_log', 'hey_this_errors.log');
printRightContent();
?>
</div>
<?php
}
?>
common.php:
<?php
/* Optimize site using GZIP Compression also see .htaccess */
echo "<script>console.log('Common library checkpoint#1' );</script>";
if (substr_count($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip')) ob_start("ob_gzhandler"); else ob_start(); ?>
<?php
/* dirty code */
define("WEBNAME", "Lawyers.com");
function printRightContent()
{
echo "<script>console.log('Common library checkpoint#2' );</script>";
-------somework-----
}?>
I have also tried this link : PHP Fatal error: Call to undefined function?
But when I am implementing changes from this link it gives me error:
crbug/1173575, non-JS module files deprecated.
I have tried using adding logs in console using this way: echo "console.log('Common library checkpoint#1' );";
I am also creating the log file using this way:
error_reporting(E_ALL);
ini_set('log_errors', 1);
ini_set('error_log', 'hey_this_errors.log');