bailo81 wrote:if I understand your question i think the solution is as follows, you dont put the if statement inside the variable but do it like this:
if( $bbuserinfo['userid'] == 0) {
$template_form = "</table>
<br />
<a name=\"form\"></a>
<input type=\"hidden" name="name" value="$bbuserinfo[username]\">
<input type=\"hidden\" name=\"name\" value=\"$bbuserinfo[username]\">
<table border=\"$tableborder\" width=\"$tablewidth\" cellspacing=\"$tablecellspacing\" cellpadding=\"$tablecellpadding\" align=\"$tablealign\" class=\"tableborder\">
<tr>
<td colspan=\"2\" class=\"tabletitle\">Post a Comment</td>
</tr>
<tr>
<td colspan=\"2\" class=\"tablewindow\">
<textarea rows=\"15\" cols=\"70\" id=commentsbox name=\"comments\"></textarea><br />
<input type=\"submit\" name=\"submit\" value=\"Add My Comment\">
</td>
<td class=\"tablewindow2\">{smilies}</td>
</tr>
</table>";
}
else {
$template_form = "</table>
<br />
<a name=\"form\"></a>
<center>Sorry, but guests cannot post comments! Reserved for members only!<br />
Please <a href=\"$forums_url/login.php?\">Login</a> or <a href=\"$forums_url/register.php?\">Register</a></center>";
}
echo $template_form;
You also can't echo inside a variable
Ha, can't believe how stupid I was. Thank you for the support. I really do appreciate it.
bailo81 wrote:
there's also a load of the backslashes that are escaping the speech marks missing, you need to make sure you have all of those otherwise you've got no chance of it working.
Looking through it there seem to be a lot of general syntax errors which you need to sort out, there are a whole host of mistakes by the looks of things that you'll need to sort out before it will work
Yes, actually this is the CuteNews script that I was tring to do a easy modification ro make i tso tat only registered users may post comments, which is why i was tring for a if command. Cutenews like alot of other free scripts, has general errors like not closing all tags, not closing all quotes, etc.
So, yeah, I bet more is in there that has stuff like this, but I'll just leave it alone as I hope to make my own news script once i gain enough experience to.
Thanks again!