PDA

View Full Version : Grab IP address with PHP



CardingMafia Admin
03-16-2013, 09:49 AM
Today I’ll be showing you how to grab somebodies IP address when they visit a page.
The variable to use is $_SERVER['REMOTE_ADDR'] - It’s that simple. You can use it
for just about anything, here are a few examples.
Printing the Users IP Address:
<?php
print ($_SERVER['REMOTE_ADDR'], "I'm Watching You!");
?>
Printing it to a File:
<?php
$ip = $_SERVER['REMOTE_ADDR'];
$handle = fopen('ipaddresses.txt'', 'a+);
fwrite($handle, $ip); fwrite($handle, "\n");
fclose($handle);
?>
All you have to do, is to make a text file and insert any of these codes or one of your
own and save it as anythingyouwant.php
Then upload it to your website and it'll do the trick
The Possibilities for what you can use this to are endless.
Good luck

Adil
02-13-2015, 06:42 AM
nice but also tell what more we can do with remote ip and what tool we should use to get into their pc with just their remote ip lol

dankstarr
02-27-2017, 08:45 PM
nice thanks for this man

WarnerBross
01-16-2018, 06:55 AM
Good job man, thanks for sharing !