Jump to content
xisto Community
Sign in to follow this  
HmmZ

Is This Any Good? Sucky webdesigner asking for feedback

Recommended Posts

I finally have my first page done (index.php) but I know from experience that there always is something wrong ( :D )
So I would like some feedback on my index script

<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://forums.xisto.com/;     <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)

Share this post


Link to post
Share on other sites

you should put it up online. so we can actually see the site aswell, then we could probably give a better feedback. Cause i dont think people wanna check over the whole script for errors...its kinda long...

Share this post


Link to post
Share on other sites

You can condense some code or put outside the index.php and call them with functions. For example code like cascading style sheet can be outside the index for sure. Likewise you can do others too so that it will fasten the page loading reducing undue waiting time which users get irritated and usually don't feel like visiting the site again.

Share this post


Link to post
Share on other sites

It actually only is 9kbIf i make a seperate header and footer and menu, would i need to do the following to each page?include("header.php");include("menu.php");include("footer.php");would that work?And for the CSS, it's a small style piece, wouldn't need a whole new .css file, and, if i do the menu.php seperate (include("menu.php"):D it would cut down the css by 1/3 :DOw, I would LOVE to put it up, But i've requested the free hosting package 2 days ago now and still no response >.>. Ill try to check it out on php designer 2005

Share this post


Link to post
Share on other sites
<!-- 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><br></tr>  <tr>         <td bgcolor="#ffffff"><img src="images/menu_img.gif"><a class="menubarlink" href="/">Home</a></td><br></tr>     <tr>  <td bgcolor="#ffffff"><img src="images/menu_img.gif"><a class="menubarlink" href="forum">Forum</a></td><br></tr>  <tr>  <td bgcolor="#ffffff"><img src="images/menu_img.gif"><a class="menubarlink" href="Reviews.php">Reviews</a></td><br></tr>  <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://forums.xisto.com/;     <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 -->

It's not showing correctly, the tables i created in there should come below each other, like phpnuke has it (on the left)

What am i doing wrong?

Share this post


Link to post
Share on other sites

Sorry,
I don't exactly follow you, "there's no was to tell".

look at the following (more cutdown) script:

<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><br></tr> <tr>        <td bgcolor="#ffffff"><img src="images/menu_img.gif"><a class="menubarlink" href="/">Home</a></td><br></tr>    <tr> <td bgcolor="#ffffff"><img src="images/menu_img.gif"><a class="menubarlink" href="forum">Forum</a></td><br></tr> <tr> <td bgcolor="#ffffff"><img src="images/menu_img.gif"><a class="menubarlink" href="Reviews.php">Reviews</a></td><br></tr> <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>

I want these menulinks, to be right under each other, having 1 table, 150*250px, looking like this:
_____________________
| Main |
| Home |
| Forum |
| Reviews |
| Downloads |
|____________________|

the <img src="images/menu.gif"> is just a small sumup image.

while, my current table, looks this this:
_____________________
| M | H | F | R | D |
| a | o | o | e | o |
| i | m | r | v | w |
| n | e | u | i | n |
| | | m | w | l |
| | | | s | o |
| | | | | a |
| | | | | d |
| | | | | s |
|___|___ |____|__|____|

Help?:D

Share this post


Link to post
Share on other sites

Nevermind the above posts guys, I (finally) received my free hosting (yay :D )

But I started nearly completely over, because it looked like crap lol..

Anywayz, I have a new question now
I started from scratch, so that everything comes to its place..
Only, it's not on its place,

Go to this link:
http://forums.xisto.com/no_longer_exists/

You notice how the logo (top image) doesnt position correctly? Its abouts 5-10px from the top, and Thats my first question, how do I get that to position to the top, I tried the following but apparently didn't work:

<table style="pos" border="0" cellpadding="0" cellspacing="0" width="100%" background="#ffffff" valign="top">	<tr>  <td height="150" bgcolor="#ffffff">  <a href="/">  <img border="0" src="images/logo.gif" width="800" height="150" valign="top"/></a></td>	</tr></table>

with
.pos {position: absolute;      top: 0px;      left:0px;	}

Any help there, appreciated

Now for another question (doh!)
The menu (as you can notice in the link) is positioned miles away from the logo (top image)
I want that to be positioned 10-20pixels BENEATH the logo, I tried this:

<table class="pos1" background-IMAGE: url(http://forums.xisto.com/no_longer_exists/;  width="150" height="250" align="left" valign="top">/////MenuLINKS (EDITED!)</table>

with
.pos1 {position: absolute;      top: 160px;      left:0px;	}

Any help here ALSO appreciated (if you solve one, the other shouldn't be too hard too :D )

Thanks in advance..I hope

Share this post


Link to post
Share on other sites

*bump*Please, I don't think the answer is hard for any "experts" or "pros" out there, if i know this solution I can continue working on my site :/

Share this post


Link to post
Share on other sites

I saw you had

pos {position: absolute;      top: 0px;      left:0px;	}pos {position: absolute;      top: 160px;      left:0px;	}
If you are going to define classes you have to start it (in the stylesheet) with a dot. And you have defined it twice for some reason.
.pos {position: absolute;      top: 160px;      left:0px;	}
Should work.

Second, you set the style for the table by typing
<table style="pos" etc.
. That's not going to work. Try
<table class="pos" etc.
instead. When you use the style attribute you have to type CSS style as value, not class names.



Now, the spacing you have all round your page, that is a standard margin. To be sure you should set both margin and padding to 0, like so:
body {margin:0;padding:0;}

Share this post


Link to post
Share on other sites

Thanks again Bjrn, Because of your continuous support at the moment, I have increased your reputation, that's the least I can do :D

Now, I might aswell stick with this thread concerning my questions, you can ignore the above posts as they all have been solved...

I have made a member system (it's not done yet) and I can't seem to get rid of an error:

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/ridouan/public_html/Online/Index.php:7) in /home/ridouan/public_html/Online/Members/index.php on line 33

the session_start() should be working just fine :D, so I don't know what this error means.

If you want to see the index.php code, go to this link:
http://forums.xisto.com/no_longer_exists/
Since it's a pretty big file i don't want to mess up the overview of the thread even more hehe :D

Share this post


Link to post
Share on other sites

Meh..

I have seperated the menu part and the header part, so all index.php now has is includes atm XD.

Anywayz, it still wont work :D
the error i now get:

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/ridouan/public_html/Online/Index.php:7) in /home/ridouan/public_html/Online/Members/index.php on line 7

and these are the first few lines of the memberindex:
<html><head><link rel="stylesheet" type="text/css" href="http://forums.xisto.com/no_longer_exists/;{        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 you'd like to see the whole script:
http://forums.xisto.com/no_longer_exists/

and for the record, all is showing the way it should be, but seeing this error everytime is not correct :D

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.