stophon4
05-16-2004, 09:45 PM
Aright, I am literally trying to replace a database with using php only, and I think I can do it, there is just a little bit of source code that I need that I dont know what to do for...
$line = fgets ($h, 4096);
I know that searches for the whole files one line at a time, but I need it to return what line it found it on...
And then I can just tell it to read the another line of a file, almost as if the username was the fgets and the one line would be the other file, not as good as a database but very close, and here is some more code used for reading the password file:
// opens a file and read some data
$fp = fopen("password.dat", "r");
$data = fgets($fp, $username_line);
// where are we ?
echo ftell($fp); // 11
So is that all I need?
and I will probably use base64 encrypting too, isn't that good enough for a replacement for a database?
$line = fgets ($h, 4096);
I know that searches for the whole files one line at a time, but I need it to return what line it found it on...
And then I can just tell it to read the another line of a file, almost as if the username was the fgets and the one line would be the other file, not as good as a database but very close, and here is some more code used for reading the password file:
// opens a file and read some data
$fp = fopen("password.dat", "r");
$data = fgets($fp, $username_line);
// where are we ?
echo ftell($fp); // 11
So is that all I need?
and I will probably use base64 encrypting too, isn't that good enough for a replacement for a database?