PHP - Show code once per IP

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ridikuloz
    Confirmed User
    • Jun 2005
    • 2080

    #1

    PHP - Show code once per IP

    <?php
    $ipaddy = $_SERVER['REMOTE_ADDR'];
    $query = "INSERT INTO ipbase(ip) VALUES('$ipaddy')";
    $result = mysql_query($query) or die(mysql_error());
    $query = mysql_query("SELECT ip FROM ipbase WHERE ip = '$ipaddy'");

    if (!$query){
    echo 'Welcome';
    }
    else
    {
    echo "Welcome Back!'';

    }

    ?>


    Here is the code what I have but for some reason it isn't working properly. Anyone see anything wrong here?
    Each persons' level of stupidity makes us different.
  • Dynamix
    G F Y not
    • Jan 2004
    • 2910

    #2
    yes, your mysql isn't anywhere near being correct..

    TGPFactory Full TGP Design & Installation Services
    ICQ 250 142 484 · AIM TGPDynamix · Email: patrick (at) tgpfactory (dot) com
    See who I am at AdultWhosWho.com!

    Comment

    • Babaganoosh
      ♥♥♥ Likes Hugs ♥♥♥
      • Nov 2001
      • 15841

      #3
      using mysql for that is a massive waste of resources. use cookies
      I like pie.

      Comment

      • Babaganoosh
        ♥♥♥ Likes Hugs ♥♥♥
        • Nov 2001
        • 15841

        #4
        using mysql for that is a massive waste of resources. use cookies
        I like pie.

        Comment

        Working...