Results 1 to 5 of 5

Thread: PHP Code for IP address from visitor is not seen. How to change the ini.php
      
   

  1. #1
    VFRodriguez's Avatar
    VFRodriguez is offline Staff Sergeant
    Join Date
    Dec 2007
    Posts
    45

    Default PHP Code for IP address from visitor is not seen. How to change the ini.php

    I use the following code to obtain the IP ADDRESS of the visitors. It worked fine until five days ago when Vodahost changed the IP for my domain.
    How do I set the register_globals = OFF in the ini.php ?
    The PHP code I use is this:

    <?php
    // if register_globals_is set to off en ini.php, se aplica este formato
    //$Ip=$_SERVER['REMOTE_ADDR'];

    $Ip=@$REMOTE_ADDR;
    echo "<font color='red'>";
    echo $Ip;
    //echo int()$Ip;
    ?>

  2. #2
    navaldesign's Avatar
    navaldesign is offline General & Forum Moderator
    Join Date
    Oct 2005
    Location
    Italy
    Posts
    12,115

    Default Re: PHP Code for IP address from visitor is not seen. How to change the ini.php

    Add this in your start of page:

    <?php
    $IP_address = $_SERVER['REMOTE_ADDR'];
    ?>


    Now, ad in your BV page the text

    your IP address is: '.$IP_address.' . Include the single quotes as I have posted them.

    Format it as you like: font, size, color etc.
    Right click it, select HTML and add the following codes

    In the Before Tag:

    <?php
    echo '

    in the After Tag:

    ';
    ?>

    Of course the page must be published as .php
    Please note that any text formatting you do MUST be unique for the part '.$IP_address.'
    Navaldesign
    Logger Lite: Low Cost, Customizable, multifeatured Login script
    Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
    DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
    Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!


  3. #3
    VFRodriguez's Avatar
    VFRodriguez is offline Staff Sergeant
    Join Date
    Dec 2007
    Posts
    45

    Default Re: PHP Code for IP address from visitor is not seen. How to change the ini.php

    As you read on my threat, I have identical solution. My question is: How do I change the ini.php to registere_global = OFF in order to be seen.

  4. #4
    VFRodriguez's Avatar
    VFRodriguez is offline Staff Sergeant
    Join Date
    Dec 2007
    Posts
    45

    Default Re: PHP Code for IP address from visitor is not seen. How to change the ini.php

    THANKS. Now I see the difference !!
    With $IP_address = $_SERVER['REMOTE_ADDR']; there is no need to set registered_globals = OFF

    That would be necessary if the php code would be $Ip=@$REMOTE_ADDR;

  5. #5
    navaldesign's Avatar
    navaldesign is offline General & Forum Moderator
    Join Date
    Oct 2005
    Location
    Italy
    Posts
    12,115

    Default Re: PHP Code for IP address from visitor is not seen. How to change the ini.php

    On the contrary, your code assumes that register_globals SHOULD be ON.
    Navaldesign
    Logger Lite: Low Cost, Customizable, multifeatured Login script
    Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
    DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
    Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!


Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49