Page 1 of 1
my session is not working right
Posted: Fri Jun 14, 2002 7:36 pm
by chris12295
i have this login code:
Code: Select all
<?
session_start(); // start session.
mysql_connect("localhost");
mysql_select_db("Ads");
?>
<!-- header tags, edit to match your own, or include template header file. -->
<html>
<head>
<title>Login</title>
<head>
<body>
<?
if(!isset($username) | !isset($password)) {
// escape from php mode.
?>
<form action="<?=$PHP_SELF?><?if($QUERY_STRING){ echo"?". $QUERY_STRING;}?>" method="POST">
<table align='center'>
<tr><td><br><img src="images/logo.gif" alt="" border="0" height=60 align="left" hspace=0><br><span style="color:#000000;font-family:arial;font-size:22pt">Boat Salvage</span></tr></td>
</table>
<br>
<br>
<table height=200 cellspacing=0 cellpadding=0 width=300 border=1 bordercolorlight="#ffffff" bordercolordark="#000000" align="center">
<tr><td colspan=2 bgcolor='#004080'><center><span style="color:#dbdbdb;font-family:arial;font-size:20pt">Login</span></center></td></tr>
<tr><td colspan=2><center>Got a pert to sell? <a href='place_ad.html'>Click here!</a></center></p></tr></td>
<tr><td bgcolor="#c4d1e1" align='right'>Username:</td><td bgcolor="#dbdbdb" align='center'><input type="text" name="username"></td></tr>
<tr><td bgcolor="#c4d1e1" align='right'>Password:</td><td bgcolor="#dbdbdb" align='center'><input type="password" name="password"></td></tr>
<tr><td colspan=2 align=center><input type="submit" value="Login"></td></form></tr>
</table>
<center><i><small>Must buy an ad to become a registered user.</small></i></center>
</body>
</html>
<?
exit();
}
// If all is well so far.
session_register("$username");
session_register("$password"); // register username and password as session variables.
// Here you would check the supplied username and password against your database to see if they exist.
// For example, a MySQL Query, your method may differ.
$sql = mysql_query("select password FROM user_table WHERE username = '$username'");
$fetch_em = mysql_fetch_array($sql);
$numrows = mysql_num_rows($sql);
if($numrows != "0" & $password == $fetch_emї"password"]) {
$valid_user = 1;
}
else {
$valid_user = 0;
}
// If the username exists and pass is correct, don't pop up the login code again.
// If info can't be found or verified....
if (!($valid_user))
{
session_unset(); // Unset session variables.
session_destroy(); // End Session we created earlier.
// escape from php mode.
?>
<form action="<?=$PHP_SELF?><?if($QUERY_STRING){ echo"?". $QUERY_STRING;}?>" method="POST">
<table align='center'>
<tr><td><br><img src="images/logo.gif" alt="" border="0" height=60 align="left" hspace=0><br><span style="color:#000000;font-family:arial;font-size:22pt">Boat Salvage</span></tr></td>
</table>
<br>
<br>
<table height=200 cellspacing=0 cellpadding=0 width=300 border=1 bordercolorlight="#ffffff" bordercolordark="#000000" align="center">
<tr><td colspan=2 bgcolor='#004080'><center><span style="color:#dbdbdb;font-family:arial;font-size:20pt">Login</span></center></td></tr>
<tr><td colspan=2><center>Got a pert to sell? <a href='place_ad.html'>Click here!</a><br><span style="color:'red'">Incorrect login information. Please try again.</span></center></p></tr></td>
<tr><td bgcolor="#c4d1e1" align='right'>Username:</td><td bgcolor="#dbdbdb" align='center'><input type="text" name="username"></td></tr>
<tr><td bgcolor="#c4d1e1" align='right'>Password:</td><td bgcolor="#dbdbdb" align='center'><input type="password" name="password"></td></tr>
<tr><td colspan=2 align=center><input type="submit" value="Login"></td></form></tr>
</table>
<center><i><small>Must buy an ad to become a registered user.</small></i></center>
</body>
</html>
<?
exit();
}
?>
but if there is an incorrect login, it says: Warning: Session object destruction failed in login.php on line 66.
whats wrong with my code?
Posted: Fri Jun 14, 2002 9:26 pm
by gotDNS
well, urs is a lot of code to read if it's not my problem, but i get help, so i give it:
here are the 3 scripts i use to login, a normal page, and a logout:
Login...
Code: Select all
<?php
session_start();
mysql_connect("localhost:3306", "techy") && mysql_select_db("forum")
or $failed = "Could not connect to database.";
$result = mysql_query("select * from usrinfo where username="$username"");
$loginform = "<form method="post" action="login.php">
<img src="forumtop.gif" /><br /> <b><u>Login</u></b><br />
Username: <input type="text" size="16" maxlength="16" name="username" />
Password: <input type="password" size="16" maxlength="16" name="password" />
<input type="hidden" name="login" value="true" />
<input type="submit" value="submit" />
</form>";
$loginform2 = "<form method="post" action="login.php">
<img src="forumtop.gif" /><br /> <b>ERROR: Username or password incorrect.</b><br /><br /> <b><u>Login</u></b><br />
Username: <input type="text" size="16" maxlength="16" name="username" />
Password: <input type="password" size="16" maxlength="16" name="password" />
<input type="hidden" name="login" value="true" />
<input type="submit" value="submit" />
</form>";
echo "<html><head>
<title>Techy Board</title>
<link rel="stylesheet" type="text/css" href="forum.css" />
</head>
<body marginheight="0" marginwith="0" topmargin="0" leftmargin="0">";
$row = mysql_fetch_assoc($result);
if($rowї"password"]==md5($password))
{
$loggedin=$username;
session_register("loggedin");
if($paramsї"prevurl"])
header("Location: $prevurl");
else
echo "<img src="forumtop.gif" /><br /> <b>You are logged in as $loggedin</b> : <a href="logout.php" class="NLINK">Logout</a><br /><br />";
}
else
{
echo $loginform2;
}
?>
<br />
<table cellpadding="0" cellspacing="0" width="92%" border="0" align="center">
<tr>
<td colspan="2"><a href="index.php" class="NLINK">Techy Home</a></td>
</tr>
<tr>
<td width="20"></td>
<td>
<?php
if(session_is_registered("loggedin"))
{
echo "<a href="editup.php" class="NLINK">Edit User Profile</a><br />";
}
?>
<br /><b>NOTE: Remember, keep the language clean. Please no spamming. The cleaner the forum, the less the restrictions. Thanks. -Admin</b>
</td>
</tr>
</table>
<br /><br />
<table cellpadding="0" cellspacing="0" align="center" width="85%" class="TBL">
<tr>
<td bgcolor="#000000" height="12" align="center" colspan="3"><strong class="HEADER">Forums</strong></td>
</tr>
<tr>
<td width="65" height="30" class="NAME2" align="center">
<?php $listquery = "select count(1) from forum where forumname="general"";
$listresult = mysql_query($listquery);
while ($row = mysql_fetch_assoc($listresult)) {
echo $rowї"count(1)"];
} if($rowї"count(1)"] == "1") { echo " post"; } else { echo " posts"; } ?></td>
<td width="8" height="30" bgcolor="#DDDDDD" class="FORLIST"> </td>
<td width="*" height="30" bgcolor="#DDDDDD" class="FORLIST"><a href="genforum.php" class="NLINK">General Conversation</a></td>
</tr>
<tr>
<td width="65" height="30" class="NAME2" align="center">
<?php $listquery = "select count(1) from forum where forumname="computers"";
$listresult = mysql_query($listquery);
while ($row = mysql_fetch_assoc($listresult)) {
echo $rowї"count(1)"];
} if($rowї"count(1)"] == "1") { echo " post"; } else { echo " posts"; } ?></td>
<td width="8" height="30" bgcolor="#DDDDDD" class="FORLIST"> </td>
<td width="*" height="30" bgcolor="#DDDDDD" class="FORLIST"><a href="compforum.php" class="NLINK">Computers</a></td>
</tr>
<tr>
<td width="65" height="30" class="NAME2" align="center">
<?php $listquery = "select count(1) from forum where forumname="games"";
$listresult = mysql_query($listquery);
while ($row = mysql_fetch_assoc($listresult)) {
echo $rowї"count(1)"];
} if($rowї"count(1)"] == "1") { echo " post"; } else { echo " posts"; } ?></td>
<td width="8" height="30" bgcolor="#DDDDDD" class="FORLIST"> </td>
<td width="*" height="30" bgcolor="#DDDDDD" class="FORLIST"><a href="gameforum.php" class="NLINK">Computer Games</a></td>
</tr>
<tr>
<td width="65" height="30" class="NAME2" align="center">
<?php $listquery = "select count(1) from forum where forumname="web"";
$listresult = mysql_query($listquery);
while ($row = mysql_fetch_assoc($listresult)) {
echo $rowї"count(1)"];
} if($rowї"count(1)"] == "1") { echo " post"; } else { echo " posts"; } ?></td>
<td width="8" height="30" bgcolor="#DDDDDD" class="FORLIST"> </td>
<td width="*" height="30" bgcolor="#DDDDDD" class="FORLIST"><a href="webforum.php" class="NLINK">Web Design</a></td>
</tr>
<tr>
<td width="65" height="30" class="NAME2" align="center">
<?php $listquery = "select count(1) from forum where forumname="ut"";
$listresult = mysql_query($listquery);
while ($row = mysql_fetch_assoc($listresult)) {
echo $rowї"count(1)"];
} if($rowї"count(1)"] == "1") { echo " post"; } else { echo " posts"; } ?></td>
<td width="8" height="30" bgcolor="#DDDDDD" class="FORLIST"> </td>
<td width="*" height="30" bgcolor="#DDDDDD" class="FORLIST"><a href="utforum.php" class="NLINK">Unreal Tournament</a></td>
</tr>
<tr>
<td width="65" height="30" class="NAME2" align="center">
<?php $listquery = "select count(1) from forum where forumname="prog"";
$listresult = mysql_query($listquery);
while ($row = mysql_fetch_assoc($listresult)) {
echo $rowї"count(1)"];
} if($rowї"count(1)"] == "1") { echo " post"; } else { echo " posts"; } ?></td>
<td width="8" height="30" bgcolor="#DDDDDD" class="FORLIST"> </td>
<td width="*" height="30" bgcolor="#DDDDDD" class="FORLIST"><a href="progforum.php" class="NLINK">Programming</a></td>
</tr>
<tr>
<td width="65" height="30" class="NAME2" align="center">
<?php $listquery = "select count(1) from forum where forumname="music"";
$listresult = mysql_query($listquery);
while ($row = mysql_fetch_assoc($listresult)) {
echo $rowї"count(1)"];
} if($rowї"count(1)"] == "1") { echo " post"; } else { echo " posts"; } ?></td>
<td width="8" height="30" bgcolor="#DDDDDD" class="FORLIST"> </td>
<td width="*" height="30" bgcolor="#DDDDDD" class="FORLIST"><a href="musicforum.php" class="NLINK">Music</a></td>
</tr>
<tr>
<td width="65" height="30" class="NAME2" align="center">
<?php $listquery = "select count(1) from forum where forumname="weird"";
$listresult = mysql_query($listquery);
while ($row = mysql_fetch_assoc($listresult)) {
echo $rowї"count(1)"];
} if($rowї"count(1)"] == "1") { echo " post"; } else { echo " posts"; } ?></td>
<td width="8" height="30" bgcolor="#DDDDDD" class="FORLIST"> </td>
<td width="*" height="30" bgcolor="#DDDDDD" class="FORLIST"><a href="weirdforum.php" class="NLINK">Weird Stuff</a></td>
</tr>
<tr>
<td width="65" height="30" class="NAME2" align="center">
<?php $listquery = "select count(1) from forum where forumname="soft"";
$listresult = mysql_query($listquery);
while ($row = mysql_fetch_assoc($listresult)) {
echo $rowї"count(1)"];
} if($rowї"count(1)"] == "1") { echo " post"; } else { echo " posts"; } ?></td>
<td width="8" height="30" bgcolor="#DDDDDD" class="FORLIST"> </td>
<td width="*" height="30" bgcolor="#DDDDDD" class="FORLIST"><a href="softforum.php" class="NLINK">Computer Software</a></td>
</tr>
</table>
</body>
</html>
Page you login from...
Code: Select all
<?php
session_start();
mysql_connect("localhost:3306", "techy") && mysql_select_db("forum")
or $failed = "Could not connect to database.";
$loginform = "<form method="post" action="login.php">
<img src="forumtop.gif" /><br /> <b><u>Login</u></b><br />
Username: <input type="text" size="16" maxlength="16" name="username" />
Password: <input type="password" size="16" maxlength="16" name="password" />
<input type="hidden" name="login" value="true" />
<input type="submit" value="Login" />
</form>";
echo "<html><head>
<title>Techy Board</title>
<link rel="stylesheet" type="text/css" href="forum.css" />
</head>
<body marginheight="0" marginwith="0" topmargin="0" leftmargin="0">";
if(session_is_registered("loggedin"))
{
echo "<img src="forumtop.gif" /><br /> <b>You are logged in as $loggedin</b> : <a href="logout.php" class="NLINK">Logout</a><br /><br />";
}
else
{
echo $loginform;
}
?>
<br />
<table cellpadding="0" cellspacing="0" width="92%" border="0" align="center">
<tr>
<td colspan="2"><a href="index.php" class="NLINK">Techy Home</a></td>
</tr>
<tr>
<td width="20"></td>
<td>
<?php
if(session_is_registered("loggedin"))
{
echo "<a href="editup.php" class="NLINK">Edit User Profile</a><br />";
}
else
{
echo "<a href="signup.php" class="NLINK">Sign-Up to post</a> (free)<br />";
}
?>
<br /><b>NOTE: Remember, keep the language clean. Please no spamming. The cleaner the forum, the less the restrictions. Thanks. -Admin</b>
</td>
</tr>
</table>
<br /><br />
<table cellpadding="0" cellspacing="0" align="center" width="85%" class="TBL">
<tr>
<td bgcolor="#000000" height="12" align="center" colspan="3"><strong class="HEADER">Forums</strong></td>
</tr>
<tr>
<td width="65" height="30" class="NAME2" align="center">
<?php $listquery = "select count(1) from forum where forumname="general"";
$listresult = mysql_query($listquery);
while ($row = mysql_fetch_assoc($listresult)) {
echo $rowї"count(1)"];
} if($rowї"count(1)"] == "1") { echo " post"; } else { echo " posts"; } ?></td>
<td width="8" height="30" bgcolor="#DDDDDD" class="FORLIST"> </td>
<td width="*" height="30" bgcolor="#DDDDDD" class="FORLIST"><a href="genforum.php" class="NLINK">General Conversation</a></td>
</tr>
<tr>
<td width="65" height="30" class="NAME2" align="center">
<?php $listquery = "select count(1) from forum where forumname="computers"";
$listresult = mysql_query($listquery);
while ($row = mysql_fetch_assoc($listresult)) {
echo $rowї"count(1)"];
} if($rowї"count(1)"] == "1") { echo " post"; } else { echo " posts"; } ?></td>
<td width="8" height="30" bgcolor="#DDDDDD" class="FORLIST"> </td>
<td width="*" height="30" bgcolor="#DDDDDD" class="FORLIST"><a href="compforum.php" class="NLINK">Computers</a></td>
</tr>
<tr>
<td width="65" height="30" class="NAME2" align="center">
<?php $listquery = "select count(1) from forum where forumname="games"";
$listresult = mysql_query($listquery);
while ($row = mysql_fetch_assoc($listresult)) {
echo $rowї"count(1)"];
} if($rowї"count(1)"] == "1") { echo " post"; } else { echo " posts"; } ?></td>
<td width="8" height="30" bgcolor="#DDDDDD" class="FORLIST"> </td>
<td width="*" height="30" bgcolor="#DDDDDD" class="FORLIST"><a href="gameforum.php" class="NLINK">Computer Games</a></td>
</tr>
<tr>
<td width="65" height="30" class="NAME2" align="center">
<?php $listquery = "select count(1) from forum where forumname="web"";
$listresult = mysql_query($listquery);
while ($row = mysql_fetch_assoc($listresult)) {
echo $rowї"count(1)"];
} if($rowї"count(1)"] == "1") { echo " post"; } else { echo " posts"; } ?></td>
<td width="8" height="30" bgcolor="#DDDDDD" class="FORLIST"> </td>
<td width="*" height="30" bgcolor="#DDDDDD" class="FORLIST"><a href="webforum.php" class="NLINK">Web Design</a></td>
</tr>
<tr>
<td width="65" height="30" class="NAME2" align="center">
<?php $listquery = "select count(1) from forum where forumname="ut"";
$listresult = mysql_query($listquery);
while ($row = mysql_fetch_assoc($listresult)) {
echo $rowї"count(1)"];
} if($rowї"count(1)"] == "1") { echo " post"; } else { echo " posts"; } ?></td>
<td width="8" height="30" bgcolor="#DDDDDD" class="FORLIST"> </td>
<td width="*" height="30" bgcolor="#DDDDDD" class="FORLIST"><a href="utforum.php" class="NLINK">Unreal Tournament</a></td>
</tr>
<tr>
<td width="65" height="30" class="NAME2" align="center">
<?php $listquery = "select count(1) from forum where forumname="prog"";
$listresult = mysql_query($listquery);
while ($row = mysql_fetch_assoc($listresult)) {
echo $rowї"count(1)"];
} if($rowї"count(1)"] == "1") { echo " post"; } else { echo " posts"; } ?></td>
<td width="8" height="30" bgcolor="#DDDDDD" class="FORLIST"> </td>
<td width="*" height="30" bgcolor="#DDDDDD" class="FORLIST"><a href="progforum.php" class="NLINK">Programming</a></td>
</tr>
<tr>
<td width="65" height="30" class="NAME2" align="center">
<?php $listquery = "select count(1) from forum where forumname="music"";
$listresult = mysql_query($listquery);
while ($row = mysql_fetch_assoc($listresult)) {
echo $rowї"count(1)"];
} if($rowї"count(1)"] == "1") { echo " post"; } else { echo " posts"; } ?></td>
<td width="8" height="30" bgcolor="#DDDDDD" class="FORLIST"> </td>
<td width="*" height="30" bgcolor="#DDDDDD" class="FORLIST"><a href="musicforum.php" class="NLINK">Music</a></td>
</tr>
<tr>
<td width="65" height="30" class="NAME2" align="center">
<?php $listquery = "select count(1) from forum where forumname="weird"";
$listresult = mysql_query($listquery);
while ($row = mysql_fetch_assoc($listresult)) {
echo $rowї"count(1)"];
} if($rowї"count(1)"] == "1") { echo " post"; } else { echo " posts"; } ?></td>
<td width="8" height="30" bgcolor="#DDDDDD" class="FORLIST"> </td>
<td width="*" height="30" bgcolor="#DDDDDD" class="FORLIST"><a href="weirdforum.php" class="NLINK">Weird Stuff</a></td>
</tr>
<tr>
<td width="65" height="30" class="NAME2" align="center">
<?php $listquery = "select count(1) from forum where forumname="soft"";
$listresult = mysql_query($listquery);
while ($row = mysql_fetch_assoc($listresult)) {
echo $rowї"count(1)"];
} if($rowї"count(1)"] == "1") { echo " post"; } else { echo " posts"; } ?></td>
<td width="8" height="30" bgcolor="#DDDDDD" class="FORLIST"> </td>
<td width="*" height="30" bgcolor="#DDDDDD" class="FORLIST"><a href="softforum.php" class="NLINK">Computer Software</a></td>
</tr>
</table>
</body>
</html>
Logout script...
Code: Select all
<?php
session_start();
mysql_connect("localhost:3306", "techy") && mysql_select_db("forum")
or $failed = "Could not connect to database.";
$loginform = "<form method="post" action="login.php">
<img src="forumtop.gif" /><br /> <b><u>Login</u></b><br />
Username: <input type="text" size="16" maxlength="16" name="username" />
Password: <input type="password" size="16" maxlength="16" name="password" />
<input type="hidden" name="login" value="true" />
<input type="submit" value="Login" />
</form>";
$loginform2 = "<form method="post" action="login.php">
<img src="forumtop.gif" /><br /> <b class="RED"><i>X</i></b> <b>You have been logged out.</b><br /><br /> <b><u>Login</u></b><br />
Username: <input type="text" size="16" maxlength="16" name="username" />
Password: <input type="password" size="16" maxlength="16" name="password" />
<input type="hidden" name="login" value="true" />
<input type="submit" value="Login" />
</form>";
$loginform3 = "<form method="post" action="login.php">
<img src="forumtop.gif" /><br /> <b>ERROR: You can not logout unless you are logged in.<img src="smile.gif" /></b><br /><br /> <b><u>Login</u></b><br />
Username: <input type="text" size="16" maxlength="16" name="username" />
Password: <input type="password" size="16" maxlength="16" name="password" />
<input type="hidden" name="login" value="true" />
<input type="submit" value="Login" />
</form>";
echo "<html><head>
<title>Techy Board</title>
<link rel="stylesheet" type="text/css" href="forum.css" />
</head>
<body marginheight="0" marginwith="0" topmargin="0" leftmargin="0">";
if(session_is_registered("loggedin"))
{
session_unregister("loggedin");
echo $loginform2;
}
else
{
echo $loginform3;
}
?>
<br />
<table cellpadding="0" cellspacing="0" width="92%" border="0" align="center">
<tr>
<td colspan="2"><a href="index.php" class="NLINK">Techy Home</a></td>
</tr>
<tr>
<td width="20"></td>
<td><br /><b>NOTE: Remember, keep the language clean. Please no spamming. The cleaner the forum, the less the restrictions. Thanks. -Admin</b>
</td>
</tr>
</table>
<br /><br />
<table cellpadding="0" cellspacing="0" align="center" width="85%" class="TBL">
<tr>
<td bgcolor="#000000" height="12" align="center" colspan="3"><strong class="HEADER">Forums</strong></td>
</tr>
<tr>
<td width="65" height="30" class="NAME2" align="center">
<?php $listquery = "select count(1) from forum where forumname="general"";
$listresult = mysql_query($listquery);
while ($row = mysql_fetch_assoc($listresult)) {
echo $rowї"count(1)"];
} if($rowї"count(1)"] == "1") { echo " post"; } else { echo " posts"; } ?></td>
<td width="8" height="30" bgcolor="#DDDDDD" class="FORLIST"> </td>
<td width="*" height="30" bgcolor="#DDDDDD" class="FORLIST"><a href="genforum.php" class="NLINK">General Conversation</a></td>
</tr>
<tr>
<td width="65" height="30" class="NAME2" align="center">
<?php $listquery = "select count(1) from forum where forumname="computers"";
$listresult = mysql_query($listquery);
while ($row = mysql_fetch_assoc($listresult)) {
echo $rowї"count(1)"];
} if($rowї"count(1)"] == "1") { echo " post"; } else { echo " posts"; } ?></td>
<td width="8" height="30" bgcolor="#DDDDDD" class="FORLIST"> </td>
<td width="*" height="30" bgcolor="#DDDDDD" class="FORLIST"><a href="compforum.php" class="NLINK">Computers</a></td>
</tr>
<tr>
<td width="65" height="30" class="NAME2" align="center">
<?php $listquery = "select count(1) from forum where forumname="games"";
$listresult = mysql_query($listquery);
while ($row = mysql_fetch_assoc($listresult)) {
echo $rowї"count(1)"];
} if($rowї"count(1)"] == "1") { echo " post"; } else { echo " posts"; } ?></td>
<td width="8" height="30" bgcolor="#DDDDDD" class="FORLIST"> </td>
<td width="*" height="30" bgcolor="#DDDDDD" class="FORLIST"><a href="gameforum.php" class="NLINK">Computer Games</a></td>
</tr>
<tr>
<td width="65" height="30" class="NAME2" align="center">
<?php $listquery = "select count(1) from forum where forumname="web"";
$listresult = mysql_query($listquery);
while ($row = mysql_fetch_assoc($listresult)) {
echo $rowї"count(1)"];
} if($rowї"count(1)"] == "1") { echo " post"; } else { echo " posts"; } ?></td>
<td width="8" height="30" bgcolor="#DDDDDD" class="FORLIST"> </td>
<td width="*" height="30" bgcolor="#DDDDDD" class="FORLIST"><a href="webforum.php" class="NLINK">Web Design</a></td>
</tr>
<tr>
<td width="65" height="30" class="NAME2" align="center">
<?php $listquery = "select count(1) from forum where forumname="ut"";
$listresult = mysql_query($listquery);
while ($row = mysql_fetch_assoc($listresult)) {
echo $rowї"count(1)"];
} if($rowї"count(1)"] == "1") { echo " post"; } else { echo " posts"; } ?></td>
<td width="8" height="30" bgcolor="#DDDDDD" class="FORLIST"> </td>
<td width="*" height="30" bgcolor="#DDDDDD" class="FORLIST"><a href="utforum.php" class="NLINK">Unreal Tournament</a></td>
</tr>
<tr>
<td width="65" height="30" class="NAME2" align="center">
<?php $listquery = "select count(1) from forum where forumname="prog"";
$listresult = mysql_query($listquery);
while ($row = mysql_fetch_assoc($listresult)) {
echo $rowї"count(1)"];
} if($rowї"count(1)"] == "1") { echo " post"; } else { echo " posts"; } ?></td>
<td width="8" height="30" bgcolor="#DDDDDD" class="FORLIST"> </td>
<td width="*" height="30" bgcolor="#DDDDDD" class="FORLIST"><a href="progforum.php" class="NLINK">Programming</a></td>
</tr>
<tr>
<td width="65" height="30" class="NAME2" align="center">
<?php $listquery = "select count(1) from forum where forumname="music"";
$listresult = mysql_query($listquery);
while ($row = mysql_fetch_assoc($listresult)) {
echo $rowї"count(1)"];
} if($rowї"count(1)"] == "1") { echo " post"; } else { echo " posts"; } ?></td>
<td width="8" height="30" bgcolor="#DDDDDD" class="FORLIST"> </td>
<td width="*" height="30" bgcolor="#DDDDDD" class="FORLIST"><a href="musicforum.php" class="NLINK">Music</a></td>
</tr>
<tr>
<td width="65" height="30" class="NAME2" align="center">
<?php $listquery = "select count(1) from forum where forumname="weird"";
$listresult = mysql_query($listquery);
while ($row = mysql_fetch_assoc($listresult)) {
echo $rowї"count(1)"];
} if($rowї"count(1)"] == "1") { echo " post"; } else { echo " posts"; } ?></td>
<td width="8" height="30" bgcolor="#DDDDDD" class="FORLIST"> </td>
<td width="*" height="30" bgcolor="#DDDDDD" class="FORLIST"><a href="weirdforum.php" class="NLINK">Weird Stuff</a></td>
</tr>
<tr>
<td width="65" height="30" class="NAME2" align="center">
<?php $listquery = "select count(1) from forum where forumname="soft"";
$listresult = mysql_query($listquery);
while ($row = mysql_fetch_assoc($listresult)) {
echo $rowї"count(1)"];
} if($rowї"count(1)"] == "1") { echo " post"; } else { echo " posts"; } ?></td>
<td width="8" height="30" bgcolor="#DDDDDD" class="FORLIST"> </td>
<td width="*" height="30" bgcolor="#DDDDDD" class="FORLIST"><a href="softforum.php" class="NLINK">Computer Software</a></td>
</tr>
</table>
</body>
</html>
hope i helped
