Finding out IP info

 
Post new topic   Reply to topic    Aprelium Forum Index -> PHP
View previous topic :: View next topic  
Author Message
razorsedge
-


Joined: 06 Jan 2007
Posts: 104

PostPosted: Fri Feb 02, 2007 7:03 pm    Post subject: Finding out IP info Reply with quote

K i want to write a script to where when someone that i told 2 enter a site, it would give me their ip address... then it would send to a log file... i have searched hotscripts and kirupa and i found nothing. i dont kno what the title would be... but.. i wantit 2 be a php script... the reason i am doing this is because one of my friends is getting "verbally assualted" online and we are going to report this person. is there a way to do what i want?
Back to top View user's profile Send private message
cmxflash
-


Joined: 11 Dec 2004
Posts: 872

PostPosted: Fri Feb 02, 2007 7:10 pm    Post subject: Reply with quote

This little script will save the IP from the visitor into ip.txt.

Code:
<?php
//Start by getting the IP
$ip = $_SERVER['REMOTE_ADDR'];

//Open ip.txt
$handle = fopen("ip.txt", "w");

//Write the IP
fwrite($handle, $ip);

//Close the file
fclose($handle);

//Should probably be changed
echo "Gotcha! Your IP is saved.";
?>


An easier way would just be to check your Abyss log file for the specific URL you'll send to him.
Back to top View user's profile Send private message
AbyssUnderground
-


Joined: 31 Dec 2004
Posts: 3855

PostPosted: Fri Feb 02, 2007 7:38 pm    Post subject: Reply with quote

You should note that method does not always work for getting the IP. It will detect any ISP transparent proxies if the user operates behind one. This means the ip logged will be incorrect and cant be used to identify the user.
_________________
Andy (AbyssUnderground) (previously The Inquisitor)
www.abyssunderground.co.uk
Back to top View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> PHP All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group