Friends of InterAkt Extensions
  • Cart £0.00
  • Search
  •  Admin

  •             Navigation...
    • Home
    • News Letters
    • InterAkt Extensions
    • Extension Patches
    • Articles Index
    • Search Articles
    • Community Forum
    • About Us
    • Contact Us
    Index   ▶ General php and MySQL
    How can I detect the users IP address

    How can I detect the users IP address

    How can I detect the users IP address
    divider

    You can use one of the following:

    <?php
       echo 'Your IP is: ' . $_SERVER['REMOTE_ADDR'];
    ?>

    OR

    <?php
       echo 'Your IP is: ' . getenv('REMOTE_ADDR');
    ?>

    You will probably use the information somewhere so it might be better to set a variable

    <?php
       $usr_ip = $_SERVER['REMOTE_ADDR'];
       echo $usr_ip;
    ?>
    Written by:  Charles Brady - 28 Sep, 2009  
     
    More in "General php and MySQL"
    How do I set dynamic meta tags for a page with dynamic content
    How do I display the current ' date ' on a page
    How do I auto refresh a page after a certain number of seconds
    How do I add a Bookmark Icon or Favicon to a site
    How can I detect the users IP address
    8 Useful server variables available in PHP
    Warning: date() It is not safe to rely on the system timezone
    Using PHP date_diff() with and end date before the start date

    Articles Categories
    MX AJAX Toolbox (3)
    KTML 4 Developer (6)
    MX Calendar (6)
    MX CSS Menus (3)
    MX Dynamic Charts (2)
    MX File Upload (9)
    MX Includes (1)
    MX Kollection - Standard Edition (6)
    MX Navigation Pack (1)
    MX Send E-Mail (4)
    MX Site Search (3)
    MX User Login (2)
    MX Widgets (5)
    MX NeXTensio (3)
    General php and MySQL (8)
    General Scripts (2)
    MX Kollection - General Info (1)
    MX Kollection - Pro Edition (3)
    ADDT Toolbox (3)
    Interakt Replacements (1)
    Dreamweaver (1)
    Friends of InterAkt Extensions | Friends of InterAkt Extensions
    2025 - Friends of InterAkt Extensions
    Powered by XMS Systems and Hosted By Exelwebs
    Manage