tracking users

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
xs2manish
Forum Commoner
Posts: 26
Joined: Mon Aug 22, 2005 10:46 pm

tracking users

Post by xs2manish »

Hi All

i want to make an application where i can keep the user stats. i did some r&d and found that the following kind of js is on the page

<script type="text/javascript">
<!--
url = window.location
referrer = document.referrer
document.write('<'+'i'+'m'+'g src=http://www.centrum-oriflame.pl/stats.ph ... '+referrer+'>')
-->
</script>

but i could not make out how do i retireve the information on the php at the bcakend. i mean how will this image being displayed on the page will tell me abt the referrer . i mean how do i retrieve this info on my php page

help please.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

$_GET['url']
$_GET['referrer']

If your pages are php already, $_SERVER['REQUEST_URI'] and $_SERVER['HTTP_REFERER'] already have that information.
xs2manish
Forum Commoner
Posts: 26
Joined: Mon Aug 22, 2005 10:46 pm

Post by xs2manish »

feyd | Please use

Code: Select all

and

Code: Select all

tags where appropriate when posting code. Read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]


please accept my apologies for not putting up the query properly. I want to design a referral tracker program for my clients website. below is the kind of info that i found on net from one of the running free counter sites:

Code: Select all

<font size=1><script type="text/javascript" language="javascript"><!--
_d=document; 
_n=navigator; 
_t=new Date(); 
function t() 
{
_d.write(
"<img src=\"http://counter.search.bg/cgi-bin/c?_id=342565&_z=0&_r="+
_r+"&_c="+_c+"&_j="+_j+"&_t="+(_t.getTimezoneOffset())+"&_k="+_k+
"&_l="+escape(_d.referrer)+"\" width=70 height=15 "+
"border=0>");
}
_c="0"; 
_r="0"; 
_j="U"; 
_k="U"; 
_d.cookie="_c=y";
_d.cookie.length>0?_k="Y":_k="N";
//-->
</script>
<script type="text/javascript" language="javascript1.2">
<!--
_b=screen; 
_r=_b.width; 
_n.appName!="Netscape"?_c=_b.colorDepth : _c=_b.pixelDepth;
_n.javaEnabled()?_j="Y":_j="N";
//-->
</script>
<a href="http://counter.search.bg/cgi-bin/s?_id=342565"
target="_top">
<script type="text/javascript" language="javascript">
<!--
t();
//-->
</script>
can anyone tell me if it is possible to pass all this information to page(on some other site) with out clicking on some link to reach there.
i m asking this because i want to place this type of code in my clienst website. now if anyone visits there website then i should be able to keep track of that info.

m extremely sorry to put this question in such an wakward manner.


feyd | Please use

Code: Select all

and

Code: Select all

tags where appropriate when posting code. Read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]
xs2manish
Forum Commoner
Posts: 26
Joined: Mon Aug 22, 2005 10:46 pm

Post by xs2manish »

Hi all this time i m being more precise.


well i m newbie in php.........so plz dont get annoyed ...........i know that suing the http_refferrer i can get all those links that are referring to my website.but i m looking for the following
referral tracking tool
built in the following manner
two parts js + php page
js on the websites where i have to track the referrals(clients website or any websie that wants this tool)
php with me so that i can give them the reports

guess i have made myself more clear now. plz let me know how do i do that.

Regards
xs2manish
Forum Commoner
Posts: 26
Joined: Mon Aug 22, 2005 10:46 pm

Post by xs2manish »

hey guys

i googled the web and found that my requirement can be fulfilled by using image beacons infact i even got something very near to what i want
here is the javascript that needs to be put on the website whose referral i need to track

Code: Select all

<img src="/set_width.php?w=800" alt="" border="0" />
below is the php page of my server

Code: Select all

<?php

// Filename: SET_WIDTH.PHP

// Initialise session stuff here

// Start processing user's browser information
$_SESSION['width'] = (!is_numeric($_GET['w'])? 800 : $_GET['w'] );
// End of processing.

// Send a BEACON image back to the user's browser
header( 'Content-type: image/gif' );
# The transparent, beacon image
echo chr(71).chr(73).chr(70).chr(56).chr(57).chr(97).
chr(1).chr(0).chr(1).chr(0).chr(128).chr(0).
chr(0).chr(0).chr(0).chr(0).chr(0).chr(0).chr(0).
chr(33).chr(249).chr(4).chr(1).chr(0).chr(0).
chr(0).chr(0).chr(44).chr(0).chr(0).chr(0).chr(0).
chr(1).chr(0).chr(1).chr(0).chr(0).chr(2).chr(2).
chr(68).chr(1).chr(0).chr(59);
?>
but still i m not able to get it work properly. i mean i still can not retrieve the value of 'w'. can anyone look into this and help me.

Regards
Manish
Post Reply