cntrybob
03-02-2003, 01:39 AM
Am working on a simple card script that reads and writes to a text file instead of a database ... can write to the file , but can't read from and get print to work ...see anything here?
function ReadFromFile () {
$TheFile = "card.txt";
$Open = fopen ($TheFile, "r");
if ($Open) {
print ("Your Birthday Wishes:
n");
$Data = file ($TheFile);
for ($n = 0; $n < count($Data);
$n++) {
$GetLine = explode("t",
$Data[$n]);
print ("$GetLine[0]
n$GetLine[1]
n");
}
fclose ($Open);
print ("<hr>
n");
} else {
print ("Unable to read from file!
n");
}
}
any print after this will print to the page, but nothing from the ReadFromFile is getting to the page ... not even Unable to read from file!
appreciate any help .. thanks
function ReadFromFile () {
$TheFile = "card.txt";
$Open = fopen ($TheFile, "r");
if ($Open) {
print ("Your Birthday Wishes:
n");
$Data = file ($TheFile);
for ($n = 0; $n < count($Data);
$n++) {
$GetLine = explode("t",
$Data[$n]);
print ("$GetLine[0]
n$GetLine[1]
n");
}
fclose ($Open);
print ("<hr>
n");
} else {
print ("Unable to read from file!
n");
}
}
any print after this will print to the page, but nothing from the ReadFromFile is getting to the page ... not even Unable to read from file!
appreciate any help .. thanks