So I would like some feedback on my index script
CODE
<html>
<head>
<title>Gamer Online</title>
<meta name="Title" content="Gamer Online">
<meta name="Description" content="Where Gamers meet!">
<meta name="Keywords" content="Game, gamer, community, online, gunbound, raycrash, cybots, asdf, asdf game, global, massive, everquest, dutch, login, register, reply, great, polls, reviews, submissions, technology, website, webdesign, webhosting, free, freebies">
<meta name="Revisit-after" content="1">
<meta name="Author" content="Ridouan Ben Chammach">
<link rev="made" href="mailto:thehmmz@gmail.com">
<meta http-equiv="Reply-to" content="thehmmz@gmail.com">
<meta name="Copyright" content="HmmZ 2005">
<meta http-equiv="Content-language" content="en">
<meta name="Rating" content="General">
<style>
a:link { color: #868585; }
a:visited { color: #868585; }
a:hover { color: #ffffff; }
a:active { color: #868585; }
menubarlink a:link { color: #716F6F; }
menubarlink a:visited { color: #716F6F; }
menubarlink a:hover { color: #ffffff; }
menubarlink a:active { color: #716F6F; }
footer a:link { color: #555454; }
footer a:visited { color: #555454; }
footer a:hover { color: #ff0000; }
footer a:active { color: #555454; }
</style>
</head>
<body>
<!-- Navigation Header Start -->
<table border="0" cellpadding="0" cellspacing="0" width="100%" background="#ffffff">
<tr>
<td height="150" bgcolor="#ffffff">
<a href="/">
<img border="0" src="logo.gif" width="800" height="150" /></a></td>
</tr>
<tr>
<td height="10" bgcolor="#82B5D4" background="logomenusep.gif"></td>
</tr>
</table>
<!-- Navigation Header End -->
<!-- Main Start -->
<table border="0" cellspacing="0" cellpadding="0" background="#ffffff" width="100%">
<tr>
<td height="10" bgcolor="#ffffff" background="images/logomenusep.gif"></td>
</tr>
<!-- Navigation -->
<table border="#" style="border-style: groove; border-color: grey;" width="150" height="250" align="left" valign="top">
<tr>
<td bgcolor="#dadada"><font color="#000000"><b>Main</b></font></td>
<td bgcolor="#ffffff"><img src="images/menu_img.gif"><a class="menubarlink" href="/">Home</a></td>
<td bgcolor="#ffffff"><img src="images/menu_img.gif"><a class="menubarlink" href="forum">Forum</a></td>
<td bgcolor="#ffffff"><img src="images/menu_img.gif"><a class="menubarlink" href="Reviews.php">Reviews</a></td>
<td bgcolor="#ffffff"><img src="images/menu_img.gif"><a class="menubarlink" href="Downloads.php">Downloads</a></td>
</tr>
</table>
<table border="0" cellspacing="0" cellpadding="0" align="left" valign="top">
<tr>
<td height="10"><img src="images/logomenusep.gif></td>
</tr>
</table>
<table border="#" style="border-style: groove; border-color: grey;" width="150" height="250" align="left" valign="top">
<tr>
<td bgcolor="#dadada"><font color="#000000"><b>Members</b></font></td>
<?php
print $_server['REMOTE_ADDR'];
?>
<?error_reporting(E_ALL);
session_start();
include("config.php");
include("functions.php");
if(!isset($_COOKIE['last_active']))
{
if(isset($_SESSION['user_id']))
{
mysql_query("UPDATE tbl_users SET user_lastactive = NOW() WHERE user_id = '" . $_SESSION['user_id'] . "'") or die(mysql_error());
setcookie("last_active",true,time()+5);
}
}
if(!isset($_SESSION['user_id']))
{
if(isset($_POST['login']))
{
$query = mysql_query("SELECT * FROM tbl_users WHERE user_name = '" . $_POST['user'] . "' AND user_pass = '" . md5($_POST['pass']) . "'");
$result = mysql_num_rows($query);
if(empty($result))
{
echo "<script>alert('Login Incorrect.'); document.location.href=('index.php')</script>";
}
else
{
while($row = mysql_fetch_assoc($query))
{
$user_id = $row['user_id'];
}
header("Location: index.php");
$_SESSION['user_id'] = $user_id;
}
}
else
{
?>
<b><strong>Log In</b></strong>
<form method="POST">
<input type="hidden" value="1" name="login">
Username : <input type="text" name="user" maxlength="15"><br>
Password : <input type="password" name="pass" maxlength="15"><br><br>
<input type="Submit" value="Login"><br><br>
<img src="icons/register.gif"> <a href="register.php">Register</a><br>
<img src="icons/memberlist.gif"> <a href="memberlist.php">Memberlist</a>
<?
}
}
else
{
$query = mysql_query("SELECT * FROM tbl_users WHERE user_id = '" . $_SESSION['user_id'] . "'");
while($row = mysql_fetch_assoc($query))
{
echo "Username : <b>" . $row['user_name']. "</b>";
if($row['user_pm'])
{
$msg = mysql_result(mysql_query("SELECT COUNT(1) FROM tbl_msg WHERE msg_to = '" . $_SESSION['user_id'] . "'"),0);
if(empty($msg))
{
$msg = "<font color=\"#008000\">Empty</font>";
}
elseif($msg >= $cfg['max_msg'])
{
$msg = "<font color=\"#FF0000\">FULL</font>";
}
else
{
$msg = $msg . " / " . $cfg['max_msg'];
}
echo "<br>\n";
echo "Inbox : <b>". $msg ."</b> ( <a href=\"msg.php?act=inbox\">Open</a> )";
}
}
echo "<br>\n<br>\n";
if(isset($_SESSION['admin_login']))
{
echo "<img src=\"icons/admin.gif\"> <a href=\"admin.php\">Admin Page</a>";
echo "<br>\n";
}
echo "<img src=\"icons/memberlist.gif\"> <a href=\"memberlist.php\">Memberlist</a>";
echo "<br>\n";
echo "<img src=\"icons/profile.gif\"> <a href=\"profile.php?act=edit_profile\">Change Profile</a>";
echo "<br>\n";
echo "<img src=\"icons/profile.gif\"> <a href=\"profile.php?act=view&user_id=" . $_SESSION['user_id'] . "\">My Profile</a>";
echo "<br>\n";
echo "<img src=\"icons/logoff.gif\"> <a href=\"logoff.php\">Log Off</a>";
}
?>
</tr>
</table>
<table border="0" cellspacing="0" cellpadding="0" valign="top">
<tr>
<td height="10"><img src="images/logomenusep.gif></td>
</tr>
</table>
<table border="#" style="border-style: groove; border-color: grey;" width="150" height="250" align="left" valign="top">
<tr>
<td bgcolor="#dadada"><font color="#000000"><b>Affiliates</b></font></td>
<td bgcolor="#ffffff"><img src="images/menu_img.gif"><a class="menubarlink" href="http://www.trap17.com">Trap17</a></td>
<td bgcolor="#ffffff"><img src="images/menu_img.gif"><a class="menubarlink" href="">Empty</a></td>
<td bgcolor="#ffffff"><img src="images/menu_img.gif"><a class="menubarlink" href="">Empty</a></td>
<td bgcolor="#ffffff"><img src="images/menu_img.gif"><a class="menubarlink" href="">Empty</a></td>
<td bgcolor="#dadada">Get<a clas="menubarlink" href="mailto: thehmmz@gmail.com?subject=Affiliate Request">Affiliated</a></td>
</tr>
</table>
<table border="0" cellspacing="0" cellpadding="0" valign="top">
<tr>
<td height="10"><img src="images/logomenusep.gif></td>
</tr>
</table>
<table border="#" style="border-style: groove; border-color: grey;" width="150" height="250" align="left" valign="top">
<tr>
<td bgcolor="#dadada"><font color="#000000"><b>Community</b></font></td>
<td bgcolor="#ffffff"><img src="images/menu_img.gif"><a class="menubarlink" href="games.php">Games</a></td>
<td bgcolor="#ffffff"><a class="menubarlink" href=" "></a></td>
<td bgcolor="#ffffff"><a class="menubarlink" href=" "></a></td>
</tr>
</table>
<-- Navigation End -->
<table border="#" style="border-style: solid; border-color: darkgrey;" width="400" height="200" align="center" valign="top">
<tr>
<td bgcolor="#dadada"><font color="#ff0000">Welcome to Gamer Online<br>The only Community with it's goal set to provide it's users with massive information<br>
and to give the users a nice experience<br> in both information displays as in interactivity.</font></td>
</tr>
</table>
<table border="0" cellspacing="0" cellpadding="0" valign="top">
<tr>
<td height="10"><img src="images/logomenusep.gif></td>
</tr>
</table>
<table border="0" cellspacing="0" cellpadding="0" valign="top">
<tr>
<td height="10"><img src="images/logomenusep.gif></td>
</tr>
</table>
<table border="0" cellspacing="0" cellpadding="0" valign="top">
<tr>
<td height="10"><img src="images/logomenusep.gif></td>
</tr>
</table>
<table border="0" cellspacing="0" cellpadding="0" align="center" valign="top">
<tr>
<td>
<?PHP
$number = "5";
include("path/to/show_news.php");
?>
</td>
</tr>
<-- Main End -->
<-- Footer Start -->
<table border="0" background="images/Footer.gif" cellspacing="0" cellpadding="0" valign="bottom" width="100%" height="100">
<tr>
<td><font class="footer">Copyright© <a class="menubarlink" href="/">HmmZ</a> 2005</font></td>
<td><font class="footer">This website was created and designed by Ridouan Ben Chammach</font></td>
</tr>
</table>
<-- Footer End -->
</tr>
</td>
</table>
?>
</body></html>
<head>
<title>Gamer Online</title>
<meta name="Title" content="Gamer Online">
<meta name="Description" content="Where Gamers meet!">
<meta name="Keywords" content="Game, gamer, community, online, gunbound, raycrash, cybots, asdf, asdf game, global, massive, everquest, dutch, login, register, reply, great, polls, reviews, submissions, technology, website, webdesign, webhosting, free, freebies">
<meta name="Revisit-after" content="1">
<meta name="Author" content="Ridouan Ben Chammach">
<link rev="made" href="mailto:thehmmz@gmail.com">
<meta http-equiv="Reply-to" content="thehmmz@gmail.com">
<meta name="Copyright" content="HmmZ 2005">
<meta http-equiv="Content-language" content="en">
<meta name="Rating" content="General">
<style>
a:link { color: #868585; }
a:visited { color: #868585; }
a:hover { color: #ffffff; }
a:active { color: #868585; }
menubarlink a:link { color: #716F6F; }
menubarlink a:visited { color: #716F6F; }
menubarlink a:hover { color: #ffffff; }
menubarlink a:active { color: #716F6F; }
footer a:link { color: #555454; }
footer a:visited { color: #555454; }
footer a:hover { color: #ff0000; }
footer a:active { color: #555454; }
</style>
</head>
<body>
<!-- Navigation Header Start -->
<table border="0" cellpadding="0" cellspacing="0" width="100%" background="#ffffff">
<tr>
<td height="150" bgcolor="#ffffff">
<a href="/">
<img border="0" src="logo.gif" width="800" height="150" /></a></td>
</tr>
<tr>
<td height="10" bgcolor="#82B5D4" background="logomenusep.gif"></td>
</tr>
</table>
<!-- Navigation Header End -->
<!-- Main Start -->
<table border="0" cellspacing="0" cellpadding="0" background="#ffffff" width="100%">
<tr>
<td height="10" bgcolor="#ffffff" background="images/logomenusep.gif"></td>
</tr>
<!-- Navigation -->
<table border="#" style="border-style: groove; border-color: grey;" width="150" height="250" align="left" valign="top">
<tr>
<td bgcolor="#dadada"><font color="#000000"><b>Main</b></font></td>
<td bgcolor="#ffffff"><img src="images/menu_img.gif"><a class="menubarlink" href="/">Home</a></td>
<td bgcolor="#ffffff"><img src="images/menu_img.gif"><a class="menubarlink" href="forum">Forum</a></td>
<td bgcolor="#ffffff"><img src="images/menu_img.gif"><a class="menubarlink" href="Reviews.php">Reviews</a></td>
<td bgcolor="#ffffff"><img src="images/menu_img.gif"><a class="menubarlink" href="Downloads.php">Downloads</a></td>
</tr>
</table>
<table border="0" cellspacing="0" cellpadding="0" align="left" valign="top">
<tr>
<td height="10"><img src="images/logomenusep.gif></td>
</tr>
</table>
<table border="#" style="border-style: groove; border-color: grey;" width="150" height="250" align="left" valign="top">
<tr>
<td bgcolor="#dadada"><font color="#000000"><b>Members</b></font></td>
<?php
print $_server['REMOTE_ADDR'];
?>
<?error_reporting(E_ALL);
session_start();
include("config.php");
include("functions.php");
if(!isset($_COOKIE['last_active']))
{
if(isset($_SESSION['user_id']))
{
mysql_query("UPDATE tbl_users SET user_lastactive = NOW() WHERE user_id = '" . $_SESSION['user_id'] . "'") or die(mysql_error());
setcookie("last_active",true,time()+5);
}
}
if(!isset($_SESSION['user_id']))
{
if(isset($_POST['login']))
{
$query = mysql_query("SELECT * FROM tbl_users WHERE user_name = '" . $_POST['user'] . "' AND user_pass = '" . md5($_POST['pass']) . "'");
$result = mysql_num_rows($query);
if(empty($result))
{
echo "<script>alert('Login Incorrect.'); document.location.href=('index.php')</script>";
}
else
{
while($row = mysql_fetch_assoc($query))
{
$user_id = $row['user_id'];
}
header("Location: index.php");
$_SESSION['user_id'] = $user_id;
}
}
else
{
?>
<b><strong>Log In</b></strong>
<form method="POST">
<input type="hidden" value="1" name="login">
Username : <input type="text" name="user" maxlength="15"><br>
Password : <input type="password" name="pass" maxlength="15"><br><br>
<input type="Submit" value="Login"><br><br>
<img src="icons/register.gif"> <a href="register.php">Register</a><br>
<img src="icons/memberlist.gif"> <a href="memberlist.php">Memberlist</a>
<?
}
}
else
{
$query = mysql_query("SELECT * FROM tbl_users WHERE user_id = '" . $_SESSION['user_id'] . "'");
while($row = mysql_fetch_assoc($query))
{
echo "Username : <b>" . $row['user_name']. "</b>";
if($row['user_pm'])
{
$msg = mysql_result(mysql_query("SELECT COUNT(1) FROM tbl_msg WHERE msg_to = '" . $_SESSION['user_id'] . "'"),0);
if(empty($msg))
{
$msg = "<font color=\"#008000\">Empty</font>";
}
elseif($msg >= $cfg['max_msg'])
{
$msg = "<font color=\"#FF0000\">FULL</font>";
}
else
{
$msg = $msg . " / " . $cfg['max_msg'];
}
echo "<br>\n";
echo "Inbox : <b>". $msg ."</b> ( <a href=\"msg.php?act=inbox\">Open</a> )";
}
}
echo "<br>\n<br>\n";
if(isset($_SESSION['admin_login']))
{
echo "<img src=\"icons/admin.gif\"> <a href=\"admin.php\">Admin Page</a>";
echo "<br>\n";
}
echo "<img src=\"icons/memberlist.gif\"> <a href=\"memberlist.php\">Memberlist</a>";
echo "<br>\n";
echo "<img src=\"icons/profile.gif\"> <a href=\"profile.php?act=edit_profile\">Change Profile</a>";
echo "<br>\n";
echo "<img src=\"icons/profile.gif\"> <a href=\"profile.php?act=view&user_id=" . $_SESSION['user_id'] . "\">My Profile</a>";
echo "<br>\n";
echo "<img src=\"icons/logoff.gif\"> <a href=\"logoff.php\">Log Off</a>";
}
?>
</tr>
</table>
<table border="0" cellspacing="0" cellpadding="0" valign="top">
<tr>
<td height="10"><img src="images/logomenusep.gif></td>
</tr>
</table>
<table border="#" style="border-style: groove; border-color: grey;" width="150" height="250" align="left" valign="top">
<tr>
<td bgcolor="#dadada"><font color="#000000"><b>Affiliates</b></font></td>
<td bgcolor="#ffffff"><img src="images/menu_img.gif"><a class="menubarlink" href="http://www.trap17.com">Trap17</a></td>
<td bgcolor="#ffffff"><img src="images/menu_img.gif"><a class="menubarlink" href="">Empty</a></td>
<td bgcolor="#ffffff"><img src="images/menu_img.gif"><a class="menubarlink" href="">Empty</a></td>
<td bgcolor="#ffffff"><img src="images/menu_img.gif"><a class="menubarlink" href="">Empty</a></td>
<td bgcolor="#dadada">Get<a clas="menubarlink" href="mailto: thehmmz@gmail.com?subject=Affiliate Request">Affiliated</a></td>
</tr>
</table>
<table border="0" cellspacing="0" cellpadding="0" valign="top">
<tr>
<td height="10"><img src="images/logomenusep.gif></td>
</tr>
</table>
<table border="#" style="border-style: groove; border-color: grey;" width="150" height="250" align="left" valign="top">
<tr>
<td bgcolor="#dadada"><font color="#000000"><b>Community</b></font></td>
<td bgcolor="#ffffff"><img src="images/menu_img.gif"><a class="menubarlink" href="games.php">Games</a></td>
<td bgcolor="#ffffff"><a class="menubarlink" href=" "></a></td>
<td bgcolor="#ffffff"><a class="menubarlink" href=" "></a></td>
</tr>
</table>
<-- Navigation End -->
<table border="#" style="border-style: solid; border-color: darkgrey;" width="400" height="200" align="center" valign="top">
<tr>
<td bgcolor="#dadada"><font color="#ff0000">Welcome to Gamer Online<br>The only Community with it's goal set to provide it's users with massive information<br>
and to give the users a nice experience<br> in both information displays as in interactivity.</font></td>
</tr>
</table>
<table border="0" cellspacing="0" cellpadding="0" valign="top">
<tr>
<td height="10"><img src="images/logomenusep.gif></td>
</tr>
</table>
<table border="0" cellspacing="0" cellpadding="0" valign="top">
<tr>
<td height="10"><img src="images/logomenusep.gif></td>
</tr>
</table>
<table border="0" cellspacing="0" cellpadding="0" valign="top">
<tr>
<td height="10"><img src="images/logomenusep.gif></td>
</tr>
</table>
<table border="0" cellspacing="0" cellpadding="0" align="center" valign="top">
<tr>
<td>
<?PHP
$number = "5";
include("path/to/show_news.php");
?>
</td>
</tr>
<-- Main End -->
<-- Footer Start -->
<table border="0" background="images/Footer.gif" cellspacing="0" cellpadding="0" valign="bottom" width="100%" height="100">
<tr>
<td><font class="footer">Copyright© <a class="menubarlink" href="/">HmmZ</a> 2005</font></td>
<td><font class="footer">This website was created and designed by Ridouan Ben Chammach</font></td>
</tr>
</table>
<-- Footer End -->
</tr>
</td>
</table>
?>
</body></html>
The last tag closings are just for insurance (I understand they shouldn't hurt the script)

