Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: Using PHP includes with Coppermine  (Read 4855 times)

0 Members and 1 Guest are viewing this topic.

ashleyXcore

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Female
  • Posts: 49
    • Magazine Junkie
Using PHP includes with Coppermine
« on: August 07, 2006, 08:51:35 pm »

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):

Code: [Select]
<?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?
« Last Edit: August 08, 2006, 09:53:46 am by GauGau »
Logged
"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

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Using PHP includes with Coppermine
« Reply #1 on: August 07, 2006, 10:03:15 pm »

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.
Logged

ashleyXcore

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Female
  • Posts: 49
    • Magazine Junkie
Re: Using PHP includes with Coppermine
« Reply #2 on: August 08, 2006, 09:31:57 am »

Oh, okay  :/
Thanks.
Logged
"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."
Pages: [1]   Go Up
 

Page created in 0.017 seconds with 20 queries.