1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Getting ad network to work on Windows PHP servers

Discussion in 'Co-op Advertising Network' started by rickbender1940, Aug 16, 2004.

  1. #1
    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.
    rickbender1940, Aug 16, 2004 IP