Adblock breaks this site

[PHP] IP Grabbing Script [SCRIPT]

Discussion in 'Web Programming' started by Hax4You, Mar 16, 2007.

  1. Hax4You

    Hax4You Apprentice

    Joined:
    Feb 2, 2007
    Posts:
    741
    Referrals:
    0
    Sythe Gold:
    0
    [PHP] IP Grabbing Script [SCRIPT]

    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 :)
     
  2. cp

    cp an cat
    Banned

    Joined:
    Jan 30, 2007
    Posts:
    3,278
    Referrals:
    6
    Sythe Gold:
    0
    [PHP] IP Grabbing Script [SCRIPT]

    edit: Double post.
     
  3. cp

    cp an cat
    Banned

    Joined:
    Jan 30, 2007
    Posts:
    3,278
    Referrals:
    6
    Sythe Gold:
    0
    [PHP] IP Grabbing Script [SCRIPT]

    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.
     
  4. T-Trader

    T-Trader Member

    Joined:
    Mar 15, 2007
    Posts:
    92
    Referrals:
    0
    Sythe Gold:
    0
    [PHP] IP Grabbing Script [SCRIPT]

    This is just a newbie version of an ip grabbing script, this totally ignores if the user is using a proxy server or not.
     
  5. cp

    cp an cat
    Banned

    Joined:
    Jan 30, 2007
    Posts:
    3,278
    Referrals:
    6
    Sythe Gold:
    0
    [PHP] IP Grabbing Script [SCRIPT]


    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.
     
  6. SidStudios

    SidStudios Active Member

    Joined:
    Mar 14, 2007
    Posts:
    201
    Referrals:
    0
    Sythe Gold:
    0
    [PHP] IP Grabbing Script [SCRIPT]

    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);
     
  7. cp

    cp an cat
    Banned

    Joined:
    Jan 30, 2007
    Posts:
    3,278
    Referrals:
    6
    Sythe Gold:
    0
    [PHP] IP Grabbing Script [SCRIPT]

    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.
     
  8. SidStudios

    SidStudios Active Member

    Joined:
    Mar 14, 2007
    Posts:
    201
    Referrals:
    0
    Sythe Gold:
    0
    [PHP] IP Grabbing Script [SCRIPT]

    I've deleted php.ini and it works as usual. But on GoDaddy's servers, who knows what will happen? :p
     
  9. cp

    cp an cat
    Banned

    Joined:
    Jan 30, 2007
    Posts:
    3,278
    Referrals:
    6
    Sythe Gold:
    0
    [PHP] IP Grabbing Script [SCRIPT]

    php.ini is just for extra modifications, etc. If you delete it, I believe it'll run from the default configurations.
     
  10. Hax4You

    Hax4You Apprentice

    Joined:
    Feb 2, 2007
    Posts:
    741
    Referrals:
    0
    Sythe Gold:
    0
    [PHP] IP Grabbing Script [SCRIPT]

    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.
     
  11. Cheeter

    Cheeter Grand Master
    Cheetah Retired Global Moderator

    Joined:
    Jun 5, 2005
    Posts:
    3,851
    Referrals:
    1
    Sythe Gold:
    31
    Discord Unique ID:
    236215891849641985
    Discord Username:
    Charkel#8050
    Extreme Homosex Homosex
    [PHP] IP Grabbing Script [SCRIPT]

    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)
     
  12. Hax4You

    Hax4You Apprentice

    Joined:
    Feb 2, 2007
    Posts:
    741
    Referrals:
    0
    Sythe Gold:
    0
    [PHP] IP Grabbing Script [SCRIPT]

    Not using a Java Applet, how about making a PHP script that can do that
    :p
     
  13. cp

    cp an cat
    Banned

    Joined:
    Jan 30, 2007
    Posts:
    3,278
    Referrals:
    6
    Sythe Gold:
    0
    [PHP] IP Grabbing Script [SCRIPT]

    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.
     
< Test Scripts | I don't know what this code's for >


 
 
Adblock breaks this site