Click to See Complete Forum and Search --> : Why isn't this working?


Mr_Floppy
08-14-2003, 07:16 PM
Why isn't this working?

<?php
$fileloc="guests.txt";
$file=fopen($fileloc,"r") or die("Error. Please go back and try again");
$line=fgets($file,4096);
print '<table width="75%" border="1" align="center"><b><tr><td>Name:</td><td>Date:</td><td>Comment:</td></tr>';
while (!feof($file)==false) {
list($name,$date,$comment)=explode(":",$line);
print "<tr><td>"+$name+"</td><td>"+$date+"</td><td>"+$comment+"</td></tr>";
$line=fgets($file,4096);
}
fclose($file);
?>

Quasibobo
08-15-2003, 12:49 PM
Shouldn't this:

print "<tr><td>"+$name+"</td><td>"+$date+"</td><td>"+$comment+"</td></tr>";

be:

print "<tr><td>".$name."</td><td>".$date."</td><td>".$comment."</td></tr>";