I am attempting to make part of a webpage, that basically shows what groups a user has joined. I want to put one table for the form 'makegroup' and another table for the 'groups owned', both these tables are part of the row of another bigger table. But however much I try the 'makegroup' is not getting displayed, and 'groupsowned' is taking its place completely. Any idea why this is happening? Should I post code?
<table width="90%" height="125" >
<tr bgcolor="#CCCCCC"><td height="20" colspan="2"><h4>Groups</h4>
</td></tr>
<tr bgcolor="#CCCCCC">
<?
if($accountid == $_SESSION['userid'])
{
?>
<td width="50%">
<form name="groupscreate" method="post" onsubmit="return Confirm()">
<table width="99%" height="6%" bgcolor="#CCCCCC"> <tr valign="top">
<td colspan="3"><h5>Create Groups</h5></td></tr>
<tr><td>
<input align="absmiddle" type="text" maxlength="25" name="gname" /><? if($nog==1) {echo "<br /><font color=red>Please enter a valid groupname</font>";}?></td>
<td><select name="gcategory">
<option value="General" selected>General</option>
<option value="Comedy">Comedy</option>
<option value="Education">Education</option>
<option value="Entertainment">Entertainment</option>
<option value="Gaming">Gaming</option>
<option value="Music">Music</option>
<option value="Science & Technology">Science & Technology</option>
<option value="Sports">Sports</option>
</select></td><td><input type="submit" name="makegroup" value="create group"/></td></tr>
</table>
</form>
</td>
<?
}
$grp= "SELECT * from groups where accountid='". $accountid."'";
$rest = mysql_query($grp,$connection);
$cont=0;
?>
<td width="50%" >
<table width="100%" height="20%" bgcolor="#CCCCCC" >
<tr><td colspan="10"><h5>Groups Owned</h5>
</td></tr>
<?
while($grow=mysql_fetch_array($rest))
{
$cont=$cont+1;
$gid=$grow['groupid'];
$gnam=$grow['groupname'];
$gcreator=$grow['accountid'];
if($cont==0)
{
echo "<tr>";
}
echo "<td align='left' ><a href='groups_discussions.php?id=".$gid."'><font color="."#333333"." size='-1'>".$gnam."</font></a></td>";
if($cont==5)
{echo "</tr>";}
}
?>
</table>
</td>
</tr></table>
I want to know if everything looks all right to you guys. I can;t see anything wrong, but the fact is that the form is not getting displayed :(
if($count == 5) you should reset $count =0<? if($nog==1) {echo "<br /><font color=red>Please enter a valid groupname</font>";}?>.<? if($nog==1): ?><br /><font color=red>Please enter a valid groupname</font><? endif; ?>