Using PHP includes with Coppermine Using PHP includes with Coppermine
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Using PHP includes with Coppermine

Started by ashleyXcore, August 07, 2006, 08:51:35 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

ashleyXcore

Okay, I hope this is in the right forum.

I want to use this script to track my referrers, but I need to include this piece of code at the top of all pages (or in a header file):

<?php if(basename($_SERVER['SCRIPT_FILENAME']) != 'referrers.php'){ include('dir/referrers.php'); } ?>

Where can I put this? I have tried putting it in a couple places but I get sql errors or something, I'm obviously going about it wrong. Help me?
"There are many kinds of eyes. Even the sphinx has eyes — and consequently there are many kinds of 'truths', and consequently there is no truth."

Joachim Müller

You can't include a script that modifies the headers or messes with the database connection. As suggested in the docs, you could use the custom_header for inclusion of PHP scripts in cpg1.4.x. In cpg1.3.x, there are other methods in cpg1.3.x that enable you toinclude scripts (you need to add the include to the pageheader function). However, you can't include all sort of scripts. What you're up to won't work, sorry.

ashleyXcore

"There are many kinds of eyes. Even the sphinx has eyes — and consequently there are many kinds of 'truths', and consequently there is no truth."