Jump to content

Tracking script


danx30

Recommended Posts

Okay here's how it goes.  A user with a username visits my website.  That username is saved into a cookie.  They visit my affiliate, signup with the affiliate and I have it set with the affiliate for pixel tracking and point it to a .php page with the code.  They give me 2 pixel tracking options:

 

<SCRIPT language="javascript" src="http://www.myserver.com/tracking.php"></SCRIPT>

and

< IMG src="http://www.myserver.com/tracking.php" height="1" width="1">

 

I'm not sure which one to use.  Below is my tracking.php script.

 

<?php

$n1 = $HTTP_COOKIE_VARS["cookiename"];

mysql_connect("127.0.0.1", "username", "password") or die(mysql_error());

mysql_select_db("db") or die(mysql_error());

mysql_query("UPDATE users SET click5='1' where name='$n1'");

php?>

 

Which will save read the users name from the cookie and save a 1 into the database in the right spot under their name.  All well and good.  But with pixel tracking do I have to have a code in there to actually draw a 1X1 pixel, or should it just work as is?

Link to comment
https://forums.phpfreaks.com/topic/42311-tracking-script/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.