Forum Moderators: coopster
<p>This is the menu page</p>
<p> </p>
<p>test test test</p>
What am I doing wrong? Do I have to put it all in echo statements?
Cheers
themoron :@)
<title>blah</title><body bgcolor="#0000FF" text="#FFFF00">
<p>This is the menu page</p><p> </p>
<p>
<?php
echo "<center>";
/*/-------------------------------------------------------------------\
¦ Original Name : csvview.php ¦
¦ Author : Neil Maskell ¦
¦ Function : Reads a specified CSV file (Comma seperated) and ¦
¦ converts it into a readable HTML table. ¦
¦ ¦
¦ You could set up a html form with an input field ¦
¦ called filename. Then use csvview.php as the action. ¦
¦ ¦
¦ the reason cache is being disabled is because if you ¦
¦ update the csv file the cache doesnt realise and shows¦
¦ an older version of the information. ¦
¦ ¦
¦ The CSV files should (and normally are) in the format:¦
¦ field1,field2,filed3,filed4 ¦
¦ field1,field2,field3,field4 ¦
\-------------------------------------------------------------------/
*/
//
$filename = "menu.csv"; // File to open. quote out this variable if you are using a form to link to this script.
function viewlog($filename) {
$fp = fopen($filename,"r");
$file = fread($fp,65535);
$replaced = eregi_replace(",", "<td>", $file);
$replaced2 = eregi_replace("\n", "<tr><td>", $replaced);
$replaced3 = eregi_replace("\r", "<tr><td>", $replaced2);
fclose($fp);
return $replaced3;
}
// Start the table definition of your choice
echo "<table border=0 bordercolor=black cellspacing=0 align=center cellpadding=0 width=30% style='font-size:12pt'>";
echo viewlog($filename);
echo "</table>";
echo "</center>";
echo "<p> </p>";
exit;
?>
</p>
<p> </p>
<p> </p>
<p>This is the menu page</p>
<p> </p>
<p>test test test</p>
</body></html>