Uggh!!!!
I may be going about this all wrong.
My goal is to write a password protection script.
I’m a newbie to PHP, so be gentile.
I’ve written the file successfully,
now I’m trying to read from the file, however, I’m not sure how to compare the entered username (UN) & password (PW) with the UN/PW in the data file.
I can get the data to display with the following script, however,
I’m feeling kinda lost, disoriented, and a little green around the gills.
Can anyone help, or should I just drink the Koolaid?
<?php
function ReadFromFile () {
$TheFile = “wmdata.txt”;
$Open = fopen ($TheFile, “r”);
if ($Open) {
print (“Data currently listed in the data file:<P>n”);
$Data = file ($TheFile);
for ($n = 0; $n < count($Data); $n++) {
$GetLine = explode(“t”, $Data[$n]);
print (“$GetLine[0]<BR>n$GetLine[1]<P>n”);
}
fclose ($Open);
print (“<HR><P>n”);
} else {
print (“Unable to read from data.txt!<BR>n”);
}
}
?>