View Full Version : Need Login System Without Database

02-17-2006, 03:13 PM
I want a user login system using a flat files for User Name & Password logging & I dont wanna use any Databases.

Can someone please write some code with detailed guidelines for me.


02-17-2006, 03:15 PM
That is so unsecure, people only have to view the flat files to get peoples passwords..

02-17-2006, 05:24 PM
It can be more secure than first thought if you think about it.

if the flat files are php..

if(header("Location : $_SERVER[PHP_SELF]")){


not sure if that code works but i have seen similar, if the page is accessed directly it wont be displayed. however it can still be included

02-21-2006, 03:08 PM

$user = "Joe";
$handle = fopen("log.php", "r");
if ($handle) {
while (!feof($handle)) {
$buffer = fgets($handle);
$sp = split(":",$buffer);

if(strtolower($user) == strtolower($sp[0])){
echo "Hi " . $sp[0] . ", your pass is " . $sp[1];

02-21-2006, 10:15 PM
Flat files that are plain text can be pretty insecure if someone (hacker) knew where to look.
But, for example, if you used PHP's MD5er for the password, it's not that bad.
But if your "database" flat file gets to be very large, it can be a performance issue.

Have you considered the built-in flat file DB SQLite?
I mean, it is a flat file in your web folder, with support built-in to PHP. Would probably use less code then using a flat file. As your username/password checks are just single queries versus manually opening a file, reading all the values, searching, etc...

07-22-2008, 11:29 AM
check this out http://tinyurl.com/6jnns7, i used it once.
i say, the demo doesnt work. but the script does, check out the main page of the website, it has the login system nicely integrated, but you cannot register.

07-22-2008, 03:24 PM
You could even use .htaccess to prevent viewing of the file anyways.

07-22-2008, 04:58 PM
What is wrong with using a database? they are insanely easy to do and very secure.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum