• Log in or sign up for an account here: https://www.sythe.org/login

Grab and Store anyone's IP. Easily.

Status
Not open for further replies.

FartKnocker

Forum Addict
Joined
Sep 3, 2007
Sythe Gold
5
Messages
285
Location
New York
There may be a time when you do need someone's IP address and they decline to tell you/show you. There is a simple way to get their ip with little knowledge at all.

First, sign up at a PHP web host (110mb.com, freehostia.com, etc, so on and so forth).

Then. Create a file in the control panel or FTP , name it "logs.txt".

Next create a new file. Name it `index.php`.

Paste the following code into it:

Code:
<?php
$ip =  $_SERVER['REMOTE_ADDR'];  // users ip is stored in the variable ip
$file = "logs.txt"; //the log file we specified
$fileopen = fopen($file, 'w') or die("error has occured"); //opens specified file
fwrite($fhopen, $ip); //writes our variable ip to the file
fclose($fileopen); //closes the file *IMPORTANT*

echo "<b>An Unknown error has occured</b>"; //just to make them think something.
?>

Each time someone visits the page, their ip will be logged in the logs.txt. Only one IP is stored since we are using fopen 'w'.

Example msn convo:

you: hey what is your iP?
them: fuck off
you: fine then i was just wondering
them: what ever
you: well i got some great pr0nz
them: sure sure! give me!
you: http://YOURDOMAIN.YOURHOST.com/index.php?greatsexypr0nz
them: wtf unknown error has occured
you: weird.. *checks http://yourdomain.YOURHOST.com/logs.txt


The log file will be located where you created it.
If you want the page to redirect instead of displaying an error, simple use the following:
PHP REDIRECT:
Code:
header("Location: http://google.com");

Javascript Redirect:
Code:
<script type="text/javascript">
window.location = 'http://google.com';
</script>

Replace google.com to what ever site you want it to redirect to.

Enjoy getting peoples ips :).
 
Interesting, but why must you go through the hassle?

Just go make a quick invisionfree, phpb, or whatever forum and when people visit the site go to "the people in last 15 minutes" and if your on an Admin account it will show the IP.

Anyways, well written guide.
 
Interesting, but why must you go through the hassle?

Just go make a quick invisionfree, phpb, or whatever forum and when people visit the site go to "the people in last 15 minutes" and if your on an Admin account it will show the IP.

Anyways, well written guide.

D'oh! Better idea than mine, and much easier for the ones who don't know about this stuff.

&& Thanks.
 
Status
Not open for further replies.
Runescape Gamblingrunescape gambling
Back
Top