Thread: PHP_AUTH_USER

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

    Join Date
    Apr 2000
    Posts
    1
    Rep Power
    0
    Hi one thing,
    I have a website that people haveto login with username and password now i use
    PHP_AUTH_USER and just make a query into the
    table, to get the login prompt i use:

    function authenticate(){
    Header("WWW-Authenticate: Basic realm="domain.com - Enter your username and password"");
    Header("HTTP/1.0 401 Unauthorized");

    My problem is this i want my users to use the login form on my webpage it's just a form with 2 fild's "password" and "login"
    but how do i use the function to do that ?
    need somehow to get that Header into www

    All help is nice thx
    Best Regards
    -ka-


    [This message has been edited by ka (edited April 25, 2000).]
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2000
    Posts
    38
    Rep Power
    15
    well, the way it sounds, i think what you are currently using is the apache authentication and not anything else. I assume that that is working...
    but what you want is to check against a database with just a form, right? well, then just make a if ($submit) { section that checks against the database (or whatever) for the correct username/password. if it's right, move on. If it's not, then either ask them to retry or just say it's wrong.
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2000
    Posts
    3
    Rep Power
    0
    Hi

    You could try using mod_auth_mysql which can be downloaded from http://ftp.sunet.se/pub/unix/databas...sql/Downloads/

    it redirects Apache authentication first to Mysql. The set up is quite easy!!

    Hope this helps

    Alex...

IMN logo majestic logo threadwatch logo seochat tools logo