Hello,
I am the admin for A-1 Radio, an internet radio station and I am attempting to add a game section to my site. The forum for the game has been no help. I have run into an issue where the line of code that is supposed to incude other files in a script is not working correctly. This is the line of code in question:
define('PATH', substr($_SERVER['SCRIPT_FILENAME'], 0, strrpos(dirname($_SERVER['SCRIPT_FILENAME']), '/') + 1));
require(PATH.'header.php');
This is the rusulting error:
Fatal error: require() [function.require]: Failed opening required 'cheader.php' (include_path='.;C:\php5\pear') in C:\Inetpub\wwwroot\games\admincp\templates\all.header.php on line 3
I have discovered by playing around with it that if "PATH" is removed from require(PATH.'header.php'), I get this error:
Fatal error: require() [function.require]: Failed opening required 'header.php' (include_path='.;C:\php5\pear') in C:\Inetpub\wwwroot\games\admincp\templates\all.header.php on line 3
As you can see, "cheader.php" becomes "header.php" the name of the file to be included.
How do I correct the script to work properly, or do I need to enable something in php.ini?
My specs:
Server 2003 Enterprise, IIS 6
PHP ver 5.2.5
Any guidance would be greatly appreciated.
Regards,
Jason Snow
A-1 Radio - The Variety Channel
www.a-1radio.com