#1
  1. No Profile Picture
    // banan2 PRIDE //
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2003
    Location
    Norway
    Posts
    303
    Rep Power
    13

    Simple usersystem (no mysql)


    I was wondering if some1 know about a script that i store username's and password's in a textfile and just put a code in my files i want to password protect (i have to add users my self)

    ~banan2
  2. #2
  3. No Profile Picture
    Got source?
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Mar 2003
    Location
    Laguna Niguel, California, USA
    Posts
    2,331
    Rep Power
    14
    If the server is apache, see http://httpd.apache.org/docs/howto/auth.html Otherwise, it is not wise to store username and password in a text file that anyone could download (If you use htpasswd it's safer because apache will not allow access to the password file).
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2003
    Posts
    325
    Rep Power
    12
    Here ya go

    To generate a password, put this into a file generate_pass.php and replace blah with your password and run it in a browser.
    PHP Code:
    <?
    $password_to_encrypt 
    'blah' 
    prrint crypt($password_to_encrypt"salt")
    ?>
    Take you new password that has been encrytped and put it in the file login.php (which i have attatched) in repalce of 'blah2'


    now just put this as the very first line of a files you want protected:
    PHP Code:
    <?include 'login.php'?>
    Attached Files
  6. #4
  7. No Profile Picture
    // banan2 PRIDE //
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2003
    Location
    Norway
    Posts
    303
    Rep Power
    13
    Never mind guys, i got MySQL and i almost fixed a usersystem that i want...

IMN logo majestic logo threadwatch logo seochat tools logo