View Full Version : newreply.php error... I need help please..
Xelation
04-11-2002, 08:02 PM
When I reply to a thread I get this error....
Parse error: parse error in /home/xelation/public_html/forum/newreply.php on line 455
here are the lines.... if anyone wants to see the file in full just pm me. thanks for any help I can get... I pretty much have to start all over on my forum if I dont get this fixed because I have no idea what hack this error came from.. :(
453 $bbuserinfo['username']=htmlspecialchars($bbuserinfo['username']); //back to norm
454 }
455 }
456
457 // redirect
filburt1
04-11-2002, 08:23 PM
You probably never opened a brace where you should have.
Xelation
04-11-2002, 08:51 PM
Originally posted by filburt1
You probably never opened a brace where you should have.
so what should I do?
Xelation
04-11-2002, 08:54 PM
oops.... sorry I gave you the wrong code in the first place... here is the correct code....
if ($post[usergroupid]==8) {
if ($bbuserinfo['usergroupid']==6 || $bbuserinfo['usergroupid']==5 || $bbuserinfo['usergroupid']==7) {
eval("\$threadreviewbits .= \"".gettemplate("threadreviewbit")."\";");
} else if ($bbuserinfo[userid]!=$post[userid]) {
eval("\$threadreviewbits .= \"".gettemplate("threadreviewbitban")."\";");
} else {
eval("\$threadreviewbits .= \"".gettemplate("threadreviewbit")."\";");
}
} else {
eval("\$threadreviewbits .= \"".gettemplate("threadreviewbit")."\";");
here is line 455 --> } else {
break;
}
}
if ($DB_site->num_rows($posts)>$maxposts) {
eval("\$threadreviewbits .= \"".gettemplate("threadreview")."\";");
}
Logician
04-12-2002, 07:00 AM
Writing your code appropriately (with correct indenment etc.) will help you trace this kind of errors:
if ($post[usergroupid]==8) {if ($bbuserinfo['usergroupid']==6 || $bbuserinfo['usergroupid']==5 || $bbuserinfo['usergroupid']==7)
{
eval("\$threadreviewbits .= \"".gettemplate("threadreviewbit")."\";");
}
//use the sytax "elseif" not "else if"!
elseif ($bbuserinfo[userid]!=$post[userid])
{
eval("\$threadreviewbits .= \"".gettemplate("threadreviewbitban")."\";");
}
else
{
eval("\$threadreviewbits .= \"".gettemplate("threadreviewbit")."\";");
}
} //you closed and stoped the if statement here!
// so this "else" seems orphan here: where is its "if"?
else
{
eval("\$threadreviewbits .= \"".gettemplate("threadreviewbit")."\";");
}
// another orphaned else! if again missing!
else {
break;
}
see?
Admin
04-12-2002, 03:59 PM
I like this structure more:
if (condition) {
// code
} elseif (other) {
// some more code
} else {
// last but not least
}
You can also use some fancy PHP editors that can match braces and tell you where you have a missing / surplus brace.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.