#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2000
    Location
    jacksonville, fl, usa
    Posts
    2
    Rep Power
    0
    hi all,

    i'd like to protect a page with a user name and password using php3.

    can anyone give me a push in the right direction please?

    thankee
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 1999
    Location
    Denmark
    Posts
    83
    Rep Power
    15
    this shold do it

    <?php
    if(!isset($PHP_AUTH_USER)) {
    Header("WWW-Authenticate: Basic realm="My Realm"");
    Header("HTTP/1.0 401 Unauthorized");
    echo "Text to send if user hits Cancel buttonn";
    exit;
    } else {
    echo "Hello $PHP_AUTH_USER.<P>";
    echo "You entered $PHP_AUTH_PW as your password.<P>";
    }
    ?>

    Just fill out the missing parts..

    ------------------
    regds..
    -ulrik-

Similar Threads

  1. password protect directory
    By twave in forum Beginner Programming
    Replies: 2
    Last Post: February 23rd, 2004, 08:14 AM
  2. Replies: 0
    Last Post: January 12th, 2004, 03:59 PM
  3. want password protect?
    By CaptinKirk in forum Beginner Programming
    Replies: 4
    Last Post: December 18th, 2003, 12:00 PM
  4. password protect - user access
    By CHIngs in forum Apache Development
    Replies: 1
    Last Post: December 17th, 2003, 10:42 PM
  5. password protect Mandrake linux
    By rganesh in forum Linux Help
    Replies: 1
    Last Post: November 22nd, 2003, 06:45 AM

IMN logo majestic logo threadwatch logo seochat tools logo