I want to make an easy login system (with sessions) where the users are stored in a text file. It should be like this:
Code: Select all
user,password,accessModerator: General Moderators
Code: Select all
user,password,accessCode: Select all
<?php
$fp = fopen("test.txt", "r") or die("Unable to open file!");
while(!feof($fp)) {
$line = trim(fgets($fp));
if(empty($line)) { continue; }
list($username, $password, $access) = explode(",", $line);
print "Username: $username - Password: $password - Access: $access\n";
}
?>
Code: Select all
user1,pass1,1
user2,pass2,1
user3,pass3,1
You don't have to be familiar with reading from text files. I just gave you the code that reads the text file.JKM wrote:Sorry, but I'm totally blank on this one. I'm not used to reading from text files.
Thanks for your help!