What's wrong with this?<

liunx

Guest
I'm trying to make a news update system using flat files. You enter in the title and content and it writes it into a table. But I'm getting parse errors and I don't know why.
Here is the part that the info is entered:
<!-- m --><a class="postlink" href="http://www.ramptstudios.com/news/update.php">http://www.ramptstudios.com/news/update.php</a><!-- m -->
and the code for it:

<html>
<head>
<title>News Updater</title>
</head>
<body>
<form method="post" action="update.php">
News Title:<br>
<input type="text" name="title" value=""><br>
Content of News:<br>
<input type="text" name="content" value=""><br>
<input type="submit" name="submit" value="Add News">
</form>
<?php
$f = fopen("news.txt","+a");
fwrite(f$,"<table width=\"250px\" border=\"1\" style=\"border: 2px solid #000000;\">
<tr>
<td style=\"border: 2px solid #000000;\" align=\"justify\" valign=\"top\" width=\"100%\" height=\"20px\" bgcolor=\"#404040\">
<font color=\"#FFFFFF\">
<b>$_POST[title]</b>
</font>
</td></tr>
<tr><td style=\"border: 2px solid #000000;\" align=\"justify\" width=\"100%\" bgcolor=\"#404040\">$_POST[content]</td></tr></table><!--news-->");
fclose($f);
?>
</body>
</html>
and the one that shows the news:
<!-- m --><a class="postlink" href="http://www.ramptstudios.com/news/news.php">http://www.ramptstudios.com/news/news.php</a><!-- m -->

<html>
<head>
<title>Test News page</title>
</head>
<body>
<center>
<?php
$f = fopen("news.txt","+a");
$contents = fread($f, getsize());
explode("<!--news-->",$contents);
fclose($f);
?>
</body>
</html>
What am i screwing up?always look at the next line down. you should put all that in a variable.


you have f$ instead of $f

also what is

getsize() ??
 
Back
Top