Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4

Thread: Loggin Ip

  1. #1
    New to the CF scene
    Join Date
    Dec 2005
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Loggin Ip

    There is no dumb questions? If so how do u log someone's ip as Enter your site?

  • #2
    New Coder
    Join Date
    Dec 2005
    Posts
    30
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Not sure if there are server ways of doing this with things such as apache or windows (whatever you use) but I know that straight HTML can't do it. You have to use a SSL (Server Side Language) to track the IP.

  • #3
    Regular Coder
    Join Date
    Jul 2005
    Location
    LA, California
    Posts
    202
    Thanks
    0
    Thanked 0 Times in 0 Posts
    use php/mysql
    PHP Code:
    mysql table:
    ----------------------
    CREATE TABLE `ip` (
      `id` int(5) NOT NULL auto_increment,
      `ip` varchar(50) NOT NULL default '',
      PRIMARY KEY  (`id`)
    ) TYPE=MyISAM AUTO_INCREMENT=1 ;
    ---------------------
    php code on page:
    ---------------------
    <?php
    $ip 
    $_SERVER['REMOTE_ADDR'];
    $sql "INSERT INTO `ip` ( `id` , `ip` ) VALUES ( '', '$ip')";
    $query mysql_query($sql);

    print 
    "Logged: $ip"
    ?>
    -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
    There are 3 kinds of ppl those who can count and those who cant
    -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
    Script-Megafest.com Coming Oh so very soon

  • #4
    New to the CF scene
    Join Date
    Dec 2005
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Sweet!!! thx alot


  •  

    Posting Permissions

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