I'm trying to set up the co-op on a site which uses .shtml files and having difficulties. Some of the files are .php files, and the co-op is working fine on these, so it's not a problem with the php. I'm using an include in the form suggested in the FAQs: <!--#include virtual="/ad_network_379.php" --> However, the include just doesn't seem to execute. Other includes on the web site work fine. I've tried adding the following to my .htaccess file: AddType application/x-httpd-php .shtml But that didn't help either. In case it makes a difference, my host says this about php: PHP is run as a CGI binary. You may be familiar with PHP as an Apache module. We do not run PHP as an Apache module on our shared servers. Anyone have an idea what might be wrong or what I can test? Thanks in advance for your help.
Try adding a echo 'test output'; PHP: to the end of your ad_network PHP file. When you do that, do you see it on the .shtml pages by chance?
Okay, that's a good thing... means the include is working (if it wasn't, I wouldn't know what to tell you). Okay, instead of the echo line I just gave you, let's put this instead: echo 'DN = ' . $_SERVER['DOCUMENT_NAME']; PHP: That should spit out the document name (the .shtml document), does it? And if not, what is it giving you?
Okay... go ahead and take out that echo line from your ad_network PHP file. In your ad_network PHP file, change if (substr (@$_SERVER['DOCUMENT_NAME'], -6) == '.shtml') { PHP: to if (substr (@$_SERVER['DOCUMENT_NAME'], -6) == '.shtml' || true) { PHP: On your PHP file(s) that you have the include() on, remove the following line: echo $ad_network; PHP: What that will do is forget about trying to detect a .shtml file (since your server isn't telling the file name) and just output the $ad_network variable within the include.
OK, we're making some progress - thanks! It's interesting to learn all of this. This seems to have solved the issue with the .shtml files. With the .php files, the co-op links are still appearing, but I also get an error message: Warning: ini_set(): Cannot change zlib.output_compression - headers already sent in /home/www/my-site/ad_network_361.php on line 100 Would it make sense if I simply had 2 separate co-op files - one to be called by the .shtml files with the modification you suggested, and a separate one to be called by the .php files?
No, just remove the zlib.output_compression line. You will know if there is a problem by doing that right away, because if there is, the ads will look like random garbage on your .shtml pages (hopefully it's fine).