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

[PHP] IP Grabbing Script [SCRIPT]

Hax4You

Apprentice
Joined
Feb 2, 2007
Sythe Gold
0
Messages
741
Location
Dirty Jersey
For those of you who just know how to copy + paste PHP scripts to your site, here is a basic script that'll show someones IP, as IPchicken, etc. does.

PHP:
   <?php
 
$ip = $_SERVER['REMOTE_ADDR'];
echo "Your ip is: $ip";
?>

Enjoy :)
 
edit: Double post.
 
It won't work on most server configurations. You have to concatenate your variables, or else it'll show your ip as $ip.

<?php

$ip = $_SERVER['REMOTE_ADDR'];
echo "Your ip is: ".$ip." .";
?>

Just wanted to point it out. It might work on yours, but not most.
 
This is just a newbie version of an ip grabbing script, this totally ignores if the user is using a proxy server or not.
 
This is just a newbie version of an ip grabbing script, this totally ignores if the user is using a proxy server or not.


Newbie version? I think you mean basic. There is no fool-proof method of detecting whether you're behind a proxy or not, and if you have one, then show it; if you don't, you have no right to call it newbie.
 
It won't work on most server configurations. You have to concatenate your variables, or else it'll show your ip as $ip.

<?php

$ip = $_SERVER['REMOTE_ADDR'];
echo "Your ip is: ".$ip." .";
?>

Just wanted to point it out. It might work on yours, but not most.

On most, "Your ip is: $ip ."; will work.

Maybe on older versions of PHP, it will not.
But, it is always needed to do
"Your ip is: ".$ip." ."
if you are using fwrite("Your ip is: ".$ip." ." , $stream);
 
It won't work on most. I forgot the value in php.ini, but it's set false by default, so no, it won't work on most.
 
I've deleted php.ini and it works as usual. But on GoDaddy's servers, who knows what will happen? :P
 
php.ini is just for extra modifications, etc. If you delete it, I believe it'll run from the default configurations.
 
Yup.

Also, another thing.

How is an IP grabbing script going to get past a proxy?
The only other thing to do would be making a script to block proxy(s) from accessing your site.
 
Extreme Homosex
Homosex
Yup.

Also, another thing.

How is an IP grabbing script going to get past a proxy?
The only other thing to do would be making a script to block proxy(s) from accessing your site.

You could make a small java applet :p I think java works on your real ip instead of the proxy ip. (Atleast the rs applet does)
 
You could make a small java applet :p I think java works on your real ip instead of the proxy ip. (Atleast the rs applet does)

Not using a Java Applet, how about making a PHP script that can do that
:p
 
Java doesn't do it automatically. All scripting/programming languages just give what they have, which is your IP (or your proxies' ip), but you have to go the extra step yourself to make it get the actual IP address, which is what runescape does.
 
Runescape Gamblingrunescape gambling
Back
Top