Results 1 to 4 of 4
  1. #1
    Join Date
    Nov 2006
    Location
    Narrich
    Posts
    5,687
    Tokens
    0
    Habbo
    Jamesy...

    Latest Awards:

    Default page only seen by certain people

    is there a way so only certain IP adresses, or people can see a link to a webpage? if not wots the code for a password thing.

    +rep!
    Ex-janitor. Might pop in from time to time, otherwise you can grab all my information from http://jamesy.me.uk/

  2. #2
    Join Date
    Aug 2005
    Location
    Peaches bed ;)
    Posts
    2,118
    Tokens
    200

    Latest Awards:

    Default

    i'll also give +rep
    Mario

  3. #3
    Join Date
    Dec 2006
    Location
    Swindon
    Posts
    3,299
    Tokens
    215
    Habbo
    dunko

    Latest Awards:

    Default

    You could do this:

    PHP Code:
    <?php
    $password 
    $_GET["password"];

    if( isset( 
    $password ) )
    {
        if( 
    $password == "yourpasswordhere" )
        {
            echo 
    "stuff here you want only people to see";
        } else {
            echo 
    "Wrong password!";
        }
    }
    ?>
    To access it you would go to http://www.yoursite.com/yourpage.php...urpasswordhere

    Get it?

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

    Latest Awards:

    Default

    Urmm, yea, easly. Basicly u just want a backwards version of an IP blocker script (for ip method)

    PHP Code:
    <?php

    //Array of alloed ip's (continue as so.
    $allow[0] = "000.000.000.001";
    $allow[1] = "000.000.000.002";
    $allow[2] = "000.000.000.003";

    //set up start value
    $alloweduser false;

    // Loop Threw All the Ips.
    for($K 0$K<sizeof($allow); $K++)
    {
    //If an Ip matches the user ip set em as allowed.
    if($allow[$K] == $_SERVER['REMOTE_ADDR']){ 
    $alloweduser true;
    }
    }

    // stop page load if there not on allowed list
    if($alloweduser == false){die("you cannot view this page.");}

    ?>
    ^^ place at top of protected page, just add to the $allow array to allow more ips to view.. just wrote it now but i think will work

Posting Permissions

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