Turkish Property - Debt Consolidation - Links of Movies - Apply for Credit Card - Deaf Topics

PDA

View Full Version : Getting ad network to work on Windows PHP servers


rickbender1940
Aug 16th 2004, 6:48 am
Ok, I got the ad network working a few days ago on a Windows PHP server. However I had a lot of problems because the ads would only show up on the main page, not in subdirectories. After a while I realized the include_once wasn't picking up the file in the root dir. After a lot of messing around I threw in the towel and uploaded a copy of ad_network.php to every subdirectory. Crude, but it worked.


ini_set ("include_path", ini_get ("include_path") . ':../:../../:../../../:../../../../');
include_once ('ad_network.php');
echo $ad_network;



I was just reading the docs on include_path on php.net just now (normally I'm an ASP guy) and it said that:

Specifies a list of directories where the require(), include() and fopen_with_path() functions look for files. The format is like the system's PATH environment variable: a list of directories separated with a colon in Unix or semicolon in Windows.

Dumb!!!!!! Source incompatibility between different server OS's

So that's the solution if it only works on the main page, not subdirs, for Windows servers: just replace the : with ;

P.S. PHP does seem kind of neat the more I study it.