Hello I was hoping I can get some help with this.
I have this file that works perfectly online but when I test it on my local Mac OSX Apache PHP4 installation I get this error:
Fatal error: Call to undefined function: chaindlk_sidebars()
The undefined function is as follows:
function ChainDLK_sidebars()
{
global $general_pics;
global $interview_pics;
global $article_pics;
global $ads_pics;
global $form_field_size;
global $_SERVER['DOCUMENT_ROOT'];
// COPY THIS INTO ARRAY WHEN GOING LIVE *******************************************
// $_SERVER['DOCUMENT_ROOT']."/sidebars",
$include_dirs = Array(
$_SERVER['DOCUMENT_ROOT']."/interviews/sidebars"
);
$random_dir = array_rand($include_dirs);
$dir=opendir($include_dirs[$random_dir]);
$available_files=array();
while($file=readdir($dir)) {
if(substr($file, 0, 3) == "HL-" and substr($file, -4) == ".inc")
$available_files[]=$file;
}
$selected_files = array_rand($available_files,3);
foreach($selected_files as $file)
{
if (substr($available_files[$file], 0, 12) == "HL-interview") {
box_up();
include($_SERVER['DOCUMENT_ROOT'].'/interviews/sidebars/'.$available_files[$file]);
box_down();
}
else if (substr($available_files[$file], 0, 10) == "HL-SIDEBOX") {
box_up();
include($_SERVER['DOCUMENT_ROOT'].'/sidebars/'.$available_files[$file]);
box_down();
}
}
}
Like I said, this function works perfectly when uploaded to my remote server via ftp but for some reason fails locally. Do you know why?