I found a great guide on how to basically create a news system (the point is that i could use a CMS, but I wanna do everything myself....with help
Anyway, back to the topic, I'm getting weird errors in a few of my files:
<?php
function displayOneItem($id){
global $db;
$query="select * from news where id=$id";
$result=mysql_query($query);
if(mysql_num_rows($result)==0){
echo "<td align=\"center\">Bad news id</td>\n";
return;
$row=mysql_fetch_assoc($result);
echo "<table border=\"1\" width=\"300\">\n";
$title=htmlentities($row['title']);
$news=nl2br(strip_tags($row['newstext'],'<a><b><i><u>'));
echo "<TR><TD><b>$title</b></td></tr>\n";
echo "<TR><TD>$news</td></tr>\n";
echo "</table>\n";
echo "<br>\n";
displayComments($id);
}
?>
with the error: Parse error: parse error, unexpected $ in /home/ridouan/public_html/News/item.php on line 26
But, according to the guide, the displayComments($id); is a necessary line???Hhelp
ill make a shorter second, for the sake of clear reading >.>
in my main file im getting a t_string error:
Parse error: parse error, unexpected T_STRING, expecting ',' or ';' in /home/ridouan/public_html/News/main.php on line 64
you can find the full code here
Fortunately, the other 3 files (addcomment, comment and news) are seeming to work properly (no errors when I run them), hopefully someone can help here :|














