
August 28th, 2003, 03:50 AM
|
|
Registered User
|
|
Join Date: Aug 2003
Posts: 20
Time spent in forums: 4 h 20 m 39 sec
Reputation Power: 0
|
|
|
AIM tracker similar to imchaos.com
i am making a click tracker similar to one you will find at IM Chaos for AIM. the link that someone clicks on looks something like this...
http://www.website1.com/aimtracker....te2.com&name=%n
website 1 is a php enabled host while website 2 is the site visitors are directed to. the code for it is...
PHP Code:
<?
/*
* This script is copyright PHPGarage.com (On Line Construction Inc.). It may be used,
* changed, and distributed freely as long as this message and/or some type of recognition
* is given to PHPGarage.com or On Line Construction Inc.
*
* [url]http://www.phpgarage.com[/url]
* [url]http://www.onlineconstructioninc.com[/url]
*
*/
$CurrentDate = date("m-d-Y h:ia");
$TextFile = "aimtracker.html";
$Body = "$_REQUEST[name] ($CurrentDate) -> $_REQUEST[url]<br>";
$Body .= file_get_contents($TextFile);
if ($FP = fopen($TextFile, "w")){
fwrite($FP, $Body);
fclose($FP);
}
header("Location: $_REQUEST[url]");
?>
and, to see the visitors, the time they clicked the link, and the url they went to i go to...
www.website1.com/aimtracker.html
which is a blank page thats chmod to 777 so the aimtracker.php can write to it.
here is where i need help: - if there is a way to incorperate a code that sees their ip address, what is it? and how can i make it so it will write the ip address to the aimtracker.html page?
- the time it retrieves is always 2 hours ahead. is that fixable by adding h+2 or are they two separate things?
- i think i may need a separate .php file but i would like to set up a table where...
w2=http://website2.com
w3=http://website3.com
w4=http://website4.com etc.
so i can change the url
...php?url=http://website2.com&name...
-to-
...php?url=w2&name...
and it would still know to go to website 2 and record it as website 2
any help is greatly appretiated. thanks
|