Jul 26, 2008

Is This Any Good? - Sucky webdesigner asking for feedback

Free Web Hosting, No Ads > CONTRIBUTE > The Internet > Website Discussion
Pages: 1, 2, 3

free web hosting

Is This Any Good? - Sucky webdesigner asking for feedback

HmmZ
I finally have my first page done (index.php) but I know from experience that there always is something wrong ( sad.gif )
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>
        &nbsp;
        <td bgcolor="#ffffff"><img src="images/menu_img.gif"><a class="menubarlink" href="/">Home</a></td>
 &nbsp;
 <td bgcolor="#ffffff"><img src="images/menu_img.gif"><a class="menubarlink" href="forum">Forum</a></td>
 &nbsp;
 <td bgcolor="#ffffff"><img src="images/menu_img.gif"><a class="menubarlink" href="Reviews.php">Reviews</a></td>
 &nbsp;
 <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>
 &nbsp;
<?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>
        &nbsp;
        <td bgcolor="#ffffff"><img src="images/menu_img.gif"><a class="menubarlink" href="http://www.trap17.com">Trap17</a></td>
 &nbsp;
 <td bgcolor="#ffffff"><img src="images/menu_img.gif"><a class="menubarlink" href="">Empty</a></td>
 &nbsp;
 <td bgcolor="#ffffff"><img src="images/menu_img.gif"><a class="menubarlink" href="">Empty</a></td>
 &nbsp;
 <td bgcolor="#ffffff"><img src="images/menu_img.gif"><a class="menubarlink" href="">Empty</a></td>
 &nbsp;
 <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>
 &nbsp;
        <td bgcolor="#ffffff"><img src="images/menu_img.gif"><a class="menubarlink" href="games.php">Games</a></td>
 &nbsp;
        <td bgcolor="#ffffff"><a class="menubarlink" href=" "></a></td>
 &nbsp;
        <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)

 

 

 


Reply

darkmeca
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...

Reply

Styx
it's quite a long script to have for your homepage

Reply

Music
You could probably condense that some...........

Reply

Dragonfly
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.

Reply

millertime
wow, how big is that file in kb??? thats going to suck for the people who have dial up to load

Reply

HmmZ
It actually only is 9kb

If 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")wink.gif it would cut down the css by 1/3 wink.gif

Ow, 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

Reply

HmmZ
CODE
<!-- 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>
 &nbsp;
<?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>
        &nbsp;
        <td bgcolor="#ffffff"><img src="images/menu_img.gif"><a class="menubarlink" href="http://www.trap17.com">Trap17</a></td>
 &nbsp;
 <td bgcolor="#ffffff"><img src="images/menu_img.gif"><a class="menubarlink" href="">Empty</a></td>
 &nbsp;
 <td bgcolor="#ffffff"><img src="images/menu_img.gif"><a class="menubarlink" href="">Empty</a></td>
 &nbsp;
 <td bgcolor="#ffffff"><img src="images/menu_img.gif"><a class="menubarlink" href="">Empty</a></td>
 &nbsp;
 <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>
 &nbsp;
        <td bgcolor="#ffffff"><img src="images/menu_img.gif"><a class="menubarlink" href="games.php">Games</a></td>
 &nbsp;
        <td bgcolor="#ffffff"><a class="menubarlink" href=" "></a></td>
 &nbsp;
        <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?

 

 

 


Reply

round
There's no was to tell, the script is too long and incomplete. I would suggest you comment out stuff and see where things are going wrong.
round

Reply

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

look at the following (more cutdown) script:
CODE
<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?sad.gif

Reply

Latest Entries

HmmZ
Uhm...Allright

But first off, let's close this thread as all those codes are really getting on my nerves aswell laugh.gif

I'll make a new thread where we can start from scratch and at the end (when my webbie is finally finished) we can write a book..."The PHP/MySQL book of errors"...! laugh.gif

New thread will be called "Website process" (no im not original)

Reply

stevey
okay now this code is really starting to get on my nerves lol, so heres what well do, just tell me what your are trying to accomplish with your script and then ill give you a step by step script on how you can do that, e.g just name a feature you want in your site, then ill try code it and post it here for you, then you name another feature ill code it and then post it here. okay, that way it will be easier for me to work out what is wrong.

Reply

HmmZ
Replying to Stevey's last post about this (was in the wrong thread/board)

First of all, it would already be a monster size for the index.php, while these only are the header and menu boxes =/, anywayz, I tried it and it returned the following error on my webbie:
CODE
Parse error: parse error, unexpected '}' in /home/ridouan/public_html/Online/Index.php on line 171


Tried to lookup line 171 (sucks when the lines are not numbered tongue.gif), this is the closest i got (it's somewhere in this piece):
CODE
//you really need to be care ful with what is posted dont trust your users
//e.g trim the post variable for any characters, and you may want to use regular
//expressions to see if the values are valid . here is a small example
/*
$user=trim($_POST['user']);
$pass=trim($_POST['pass']);
*/
$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'];
}
/*
this is your other mistake you sent the header then registered the session
variable that wont happen the session variable wont be registerd
you need to register the session variable then redirect the browser
you may want to use relative links they are easy to maintain
instead of http://www.trap17.com/online/index.php
you should use index.php
or ../index.php
if index.php is in the root directory.
*/
//if everything is okay register the session
//you may want to start the session here
session_start();
session_register('user_id');
$_SESSION['user_id'] = $user_id;
//redirect the user to the main page.
header("Location: http://www.online.trap17.com/Online/Index.php");

}
}
else
{
?>


Of course i checked on the }`s, but seems they are all positioned correctly :s

Reply

stevey
hey this is the error in your code, you see, you start html output before you start the session you should always start your session before you output anything to the browser, since starting a session initiates the session cookie, so instead of your script being as.
QUOTE
<html>
<head><link rel="stylesheet" type="text/css" href="http://www.online.trap17.com/Online/stylesheet.css"></head><body>
<?php
session_start();

it should be
QUOTE
<?php
session_start();
?>
<html>
<head><link rel="stylesheet" type="text/css" href="http://www.online.trap17.com/Online/stylesheet.css"></head><body>
<?php
//the rest of your php code
?>

now do that and you wont get that annoying error anymore.....
hope this helps
if you have any problems pm me.

Reply

HmmZ
Lol, yea this is 1 crazy thread tongue.gif

Anywayz, it is already uploaded and online, the error i showed you is one of the outputs FROM the page:

Gamer Online

Reply



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.
Confirm Code:

Pages: 1, 2, 3
Similar Topics

Keywords : sucky webdesigner feedback


    Looking for sucky, webdesigner, feedback

Searching Video's for sucky, webdesigner, feedback
advertisement



Is This Any Good? - Sucky webdesigner asking for feedback



 

 

 

 

ADD REPLY / Got an Opinion! Remove these ADs! RAPID SEARCH! Free Web Hosting [X]
Express your Opinions, Thoughts or Contribute more info. to help others.
Ask your Doubts & Queries to get answers, So that "Together We can help others!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE