The best way to store username and password without a database

Posted by Mokuchan on Stack Overflow See other posts from Stack Overflow or by Mokuchan
Published on 2010-05-06T17:26:26Z Indexed on 2010/05/06 17:28 UTC
Read the original article Hit count: 121

Filed under:
|

Hello everyone, I want to build a simple single user login "library" in PHP, but I'm facing the following dilemma: how should I store username and password if I'm not using a database?

A simple plain text file could be easily read and then the password could be easily decripted so that's not an option.

If I create a php file with just

<?php
    $Username= "username";
    $Password= "password";
?>

then no one should be able to read it and I could simply include this file where I need it, but I'm not really sure you can't find a better way to do this!

So what's, in your opinion, the best solution to this problem (and why)?

Thanks

© Stack Overflow or respective owner

Related posts about php

Related posts about login-script