RE: read from text file problems
Posted: Mon Mar 19, 2007 6:33 pm
hey guys
havin a bit of a problem with this code, it doesnt have errors but doesnt read the txt file :s
The text file reads as follows:
Andy
havin a bit of a problem with this code, it doesnt have errors but doesnt read the txt file :s
Code: Select all
$title = isset($title);
$date = isset($date);
$content = isset($content);
$filename = "php/add.txt";
$handle = fopen($filename, "r");
$contents = fread($handle, filesize($filename));
$line = explode("|", $contents);
$line[0] = $title;
$line[1] = $date;
$line[2] = $content;
echo "<p>".$title." -- Added on: ".$date."</p><p>".$content."</p><hr />";
fclose($handle);if anyone can see any problems please let me know thankstest|19/03/05|blah blah balha ahuirgjerkb rierfihw jfwbnfi wfyq rfnweb rfi ffbqnf bq frqiufqbrfnqbrf qryfq rofq|
Andy