Is it possible to password protect a page without db access? I may have only few pages. But I should be able to change password and also save sessions etc. And I want a secure way as it’s for production site!
How is it to store in a config.php after md5:
<?php
username="admin";
password="1a1dc91c907325c69271ddf0c944bc72";
?>
If this is a good idea, is there a way to restrict access to this php from only one script
called check.php or something?
Sure, why not? You can use flat files in inaccessible directory (protected by .htaccess or out of the www root) and use that as a database.
Here’s a simple login class I’ve whipped up:
NOTE: You really should turn off error reporting if you are going to use this in an actual server. This can be done by calling error_reporting() or by adding ‘@’ in front of
file_get_contentsandfile_put_contents(ie: so it turns into@file_get_contents)Usage example: http://left4churr.com/login/