Results 1 to 4 of 4

Thread: A Little help

  1. #1
    Join Date
    Jul 2004
    Posts
    1,457
    Tokens
    0

    Latest Awards:

    Question A Little help

    I need abit of help
    What is the Script for telling the users what they're IP is,
    And what is the HTML/Script, for everytime you refresh the page a diff image comes up.
    Like Habbohut Or Habbohotel
    Thanks

  2. #2
    Join Date
    Aug 2004
    Location
    UK
    Posts
    11,283
    Tokens
    2,031

    Latest Awards:

    Default

    IP can ether be done with php or shtml

    shtml

    just write

    <!--#echo var="REMOTE_ADDR" -->


    a good php script for it (can see threw proxies etc

    <?php

    $ip = "";
    if ((isset($_SERVER['HTTP_X_FORWARDED_FOR'])) && (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])))
    {
    $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
    }
    elseif ((isset($_SERVER['HTTP_CLIENT_IP'])) && (!empty($_SERVER['HTTP_CLIENT_IP'])))
    {
    $ip = explode(".",$_SERVER['HTTP_CLIENT_IP']);
    $ip = $ip[3].".".$ip[2].".".$ip[1].".".$ip[0];
    }
    elseif ((!isset($_SERVER['HTTP_X_FORWARDED_FOR'])) || (empty($_SERVER['HTTP_X_FORWARDED_FOR'])))
    {
    if ((!isset($_SERVER['HTTP_CLIENT_IP'])) && (empty($_SERVER['HTTP_CLIENT_IP'])))
    {
    $ip = $_SERVER['REMOTE_ADDR'];
    }
    }
    else
    {
    $ip = "0.0.0.0";
    }

    echo ( $ip );

    ?>

    Random image can be done with a simple javascript

    <SCRIPT LANGUAGE="JavaScript">

    var newurls=new Array()
    newurls[0]="http://www.thybag.co.uk/page"
    newurls[1]="http://www.thybag.co.uk/page2"
    newurls[2]="http://www.thybag.co.uk/page3"

    var Images=new Array()
    Images[0]="image1.gif"
    Images[1]="image2.gif"
    Images[2]="image3.gif"

    now=new Date()
    num=(now.getSeconds())%3

    var adrs = newurls[num]
    var pic = Images[num]

    document.write("<A HREF=" + adrs + "><IMG SRC=" + pic +" BORDER=0></A>")

    </SCRIPT>

    it simply rendomly selcts one, and then attachesr the image and the url. u can ad exstra options with the

    newurls[3]="http://www.thybag.co.uk/page4"

    Images[3]="image4.gif"
    by just adding them so they fit in with the above code

  3. #3
    Join Date
    Oct 2004
    Location
    Scotland
    Posts
    2,280
    Tokens
    1,075

    Latest Awards:

    Default

    are you gonna help me with my site mentor?

    http://www.stupidian.com
    (contains mild swearing)

  4. #4
    Join Date
    Jul 2004
    Posts
    1,457
    Tokens
    0

    Latest Awards:

    Default

    Thanks alot for that

Posting Permissions

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