annoying little tracker include problem?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
lc
Forum Contributor
Posts: 188
Joined: Tue Apr 23, 2002 6:45 pm
Location: Netherlands

annoying little tracker include problem?

Post by lc »

Ok here's the situation.

On a site I designed I pasted a tracker bit from this place: http://www.extreme-dm.com/tracking/ it's a simple little tracker that does the job.

But since of course my sites are dynamic, and this thing tracks everything, at times it displays pages that not everyone should see in the referrer tracking list.

Ok so I made it so that the tracker only gets loaded when no one is logged in.

if ("$no one" == "logged in"){ include("tracker.html"); }

sort of like... you get it?

But still those pages are displayed in their referrer tracking list??? why??

I haven't a clue... mailed them about it, but thought that I am prolly overlooking something simple, so I'm asking you lovely people ;)

thx
lc
User avatar
phice
Moderator
Posts: 1416
Joined: Sat Apr 20, 2002 3:14 pm
Location: Dallas, TX
Contact:

Post by phice »

If you could include a small portion of your coding so that we could see if there is some type of error, that'd be great. :)
Image Image
lc
Forum Contributor
Posts: 188
Joined: Tue Apr 23, 2002 6:45 pm
Location: Netherlands

Post by lc »

Well... there's no error in my coding... the tracker is simply not included when it shouldn't be. It does not load tracker.html when it shouldn't. The way I see it... when you don't load a tracker, they can't track you...

But then when you do an if statement with an include in it and there's a php error in the included bit.. php does show an error... does that mean that the script is run? even if it's straight html inside a non valid include and doesn't get added to your page???

Thing is.. I can fix it ok by changing the login method to the new one I use on all the sites I make now... but this should work... I'm baffled.
User avatar
m3mn0n
PHP Evangelist
Posts: 3548
Joined: Tue Aug 13, 2002 3:35 pm
Location: Calgary, Canada

Post by m3mn0n »

setcookie()

Code: Select all

<?php
$_COOKIE['variable']
?>
Last edited by m3mn0n on Sun May 11, 2003 12:57 pm, edited 1 time in total.
lc
Forum Contributor
Posts: 188
Joined: Tue Apr 23, 2002 6:45 pm
Location: Netherlands

Post by lc »

ehm what I meant is...

is it possible the tracker is trigerred by php.exe even when it's not included in the page, but just because it's run through php because it's mentioned????

and setcookie???? why??? I do not see the relevance.
User avatar
m3mn0n
PHP Evangelist
Posts: 3548
Joined: Tue Aug 13, 2002 3:35 pm
Location: Calgary, Canada

Post by m3mn0n »

Code: Select all

<?php
// to make sure a user isn't logged in
setcookie("loggedin", "");
?>

Code: Select all

<?php
if($_COOKIE['loggedin'] == ""){
  // show tracker.html
} elseif($_COOKIE['loggedin'] == "loggedin") {
 // logged in
} else {
 // echo an &nbsp; or something
}
?>
User avatar
m3mn0n
PHP Evangelist
Posts: 3548
Joined: Tue Aug 13, 2002 3:35 pm
Location: Calgary, Canada

Post by m3mn0n »

sorry if i misunderstood the problem. :?
lc
Forum Contributor
Posts: 188
Joined: Tue Apr 23, 2002 6:45 pm
Location: Netherlands

Post by lc »

yup you misunderstood.... I am not looking for a better login script... the one I have on there works fine, and if all else fails I ahve a better one lying around.

I just don't want to implement it yet... would mean a rather extensive rewrite. And more importantly.. I want to udnerstand the issue with the tracker.

I mean, how can it track a link when it isn't included in the actual php output page?
Post Reply