...

View Full Version : whats wrong with my code?



googleit
03-08-2007, 06:32 PM
iam creating my own cms and iam trying to pull articles from a db but i get this annoying error :(

Parse error: parse error, unexpected $ in /home/content/b/r/a/bradleyhession/html/test/test2.php on line 261


<?php
if(isset($_GET['EntryID'])) //If looking at a specific Article
{
$EntryID=$_GET['EntryID'];
$tviewed = "UPDATE CMS_articles SET timesviewed=timesviewed+1
WHERE EntryID = '$EntryID'";
mysql_query($tviewed);
print "<center><table border='0' width=90% >";
print "<tr><td valign='top' width='75%' align='center'><br><br>";
print "<table border='1' width='90%' bordercolor=$borderc cellpadding='4' cellspacing='0'><tr><td bgcolor=$barcolor>";
$article="SELECT * FROM CMS_articles where EntryID='$EntryID'";
$article2=mysql_query($article) or die("It died");
while($r=mysql_fetch_array($article2))


?>
any help wud be helpful
thanks

-googleit

rafiki
03-08-2007, 06:55 PM
the almighty googleit is back....
fixed by the way :D

Inigoesdr
03-08-2007, 06:55 PM
You haven't closed your if(). What is on like 261?

rafiki
03-08-2007, 07:01 PM
You haven't closed your if(). What is on like 261?
did u read my post we managed 2 fix it:)

Alex!
03-08-2007, 07:05 PM
You also don't seem to do any validation on the $_GET['entryID']...as far as I'm aware you should always do at least some kind of validation on any kind of user input.

Alex

rafiki
03-08-2007, 07:07 PM
You also don't seem to do any validation on the $_GET['entryID']...as far as I'm aware you should always do at least some kind of validation on any kind of user input.

AlexLOL hi alex, u live quite close to me, me and googleit managed to fix this thread now, its quite unnessacary for any more posts. thanks though guys

Inigoesdr
03-08-2007, 07:10 PM
did u read my post we managed 2 fix it:)
Yes. Did you look at the time of the post? You posted just before me.

googleit
03-08-2007, 09:33 PM
thanks for your help guys i should be more care :p

_Aerospace_Eng_
03-08-2007, 10:38 PM
So...what was the solution? Others might have the same issue and would like to know the solution. Don't be selfish.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum