Jump to content

[SOLVED] WTH? Whats wrong here?


Xyphon

Recommended Posts

<?PHP
include('Connect.php');
include('top.php');
$result = mysql_query("SELECT * FROM news_comments");

echo "<table border='1'>
<tr>
<th>Hi,<br /> It's Xyphon. I have just made the news page, I hope you like it! Please, leave comments here!</th>
</tr></table>";
echo "<table border='1' width='500'>";
echo "<tr> <td> <a href='postcomment.php'>Post Comment</a></td>";
echo "<td> <a href='viewcomments.php'>View Comments</a></td></tr></table>";

if(!$row = mysql_fetch_array($result))
echo "There are no current comments. Layout issues may accure.";
else
{
echo "<table border='1' width='500' height='20'>";
echo "<br /><br />";
echo "<tr>";
echo "<td><center><b>Username: </b><br />" . $row['username'] .  "</center></td>";
echo "<td><center><b>ID: </b><br />" . $row['user_id'] .  "</center></td></tr></table>";
echo "<table border='1' width='500' height='20'><tr><td><b>Comment:</b>";
echo "<td>" . $row['comment'] . "</td>";
echo "</tr>";
}
echo "</table>";
include('bottom.php');
?>

 

for some reason if there are no comments, it displays bottom.php at like, the bottom of the page, not the right.

Link to comment
Share on other sites

Its the way your layout is setup, use something to cover it up when there are no comments

 

Replace This Line

 

if(!$row = mysql_fetch_array($result))
echo "There are no current comments. Layout issues may accure.";
else
{
echo "<table border='1' width='500' height='20'>";
echo "<br /><br />";
echo "<tr>";
echo "<td><center><b>Username: </b><br />" . $row['username'] .  "</center></td>";
echo "<td><center><b>ID: </b><br />" . $row['user_id'] .  "</center></td></tr></table>";
echo "<table border='1' width='500' height='20'><tr><td><b>Comment:</b>";
echo "<td>" . $row['comment'] . "</td>";
echo "</tr>";
}

 

TO

 

if(mysql_num_rows($result)==0){

echo "There are no current comments. Layout issues may accure.";

}
else
{
while($row = mysql_fetch_array($result)){
echo "<table border='1' width='500' height='20'>";
echo "<br /><br />";
echo "<tr>";
echo "<td><center><b>Username: </b><br />" . $row['username'] .  "</center></td>";
echo "<td><center><b>ID: </b><br />" . $row['user_id'] .  "</center></td></tr></table>";
echo "<table border='1' width='500' height='20'><tr><td><b>Comment:</b>";
echo "<td>" . $row['comment'] . "</td>";
echo "</tr>";
}
}

Link to comment
Share on other sites

Replace the View comments page with

 

<html>
<title> Pokemon Trainer's Challenge RPG </title>

<head>
<style type='text/css'>
A:link { color: #AFAFAF; text-decoration: underline; }
A:visited { color: #AFAFAF; text-decoration: underline; }
A:hover { color: #D0D0D0; text-decoration: none; } 

body 
{
background-color: #000000;
background-image: url('Url here if you have a background image');
scrollbar-face-color: #000000;
scrollbar-highlight-color: #000000;
scrollbar-shadow-color: #000000;
scrollbar-darkshadow-color: #545454;
scrollbar-3d-lightcolor: #545454;
scrollbar-arrow-color: #ffffff;
scrollbar-track-color: #545454;
}

.tables
{ border: 1px solid #252525; background-color: #313131;} 
.menus
{ width: 130px; border: 0px solid #575757; background-color: #313131;} 
.content
{ border: 0px solid #707070; background-color: #4F4F4F;} 
.disclaimer
{ border: 1px solid #252525; background-color: #313131;} 

</style>



</head>


<body>
<div align='center'>
<!--BANNER-->
<table width='750' height='180' align="center" cellpadding='0' cellspacing='0' class='tables'>
<tr><td>
<center>
<font face='verdana' color='#FFFFFF' size='6'><a href='index.php'>
<img border='0' src='http://i3.tinypic.com/7xaet08.jpg'>

</font>
</tr></td>
</table>
<!--END of BANNER-->

<!--LEFT MENU-->
<table width='750' height='250' align="center" cellpadding='4' cellspacing='0' class='tables'>
<tr><td class='menus' valign='top'>
<font color='#AFAFAF' face='verdana' size='1'>
<CENTER>
<b>Catergory</b><br>
<a href='index.php'>Home</a><br>
<a href='register.php'>Register</a><br>
<a href='login.php'>Log in</a><br>
</CENTER>
</td>
<!--END of LEFT MENU-->


<!--CONTENT-->
<td class='content' valign='top'>
<font color='#AFAFAF' face='verdana' size='1'>
<div align='justify'>
<br>
<?PHP
include('Connect.php');
include('top.php');
$result = mysql_query("SELECT * FROM news_comments");

echo "<table border='1'>
<tr>
<th>Hi,<br /> It's Xyphon. I have just made the news page, I hope you like it! Please, leave comments here!</th>
</tr></table>";
echo "<table border='1' width='500'>";
echo "<tr> <td> <a href='postcomment.php'>Post Comment</a></td>";
echo "<td> <a href='viewcomments.php'>View Comments</a></td></tr></table>";

if(mysql_num_rows($result)==0){

echo "There are no current comments. Layout issues may accure.";

}
else
{
while($row = mysql_fetch_array($result)){
echo "<table border='1' width='500' height='20'>";
echo "<br /><br />";
echo "<tr>";
echo "<td><center><b>Username: </b><br />" . $row['username'] .  "</center></td>";
echo "<td><center><b>ID: </b><br />" . $row['user_id'] .  "</center></td></tr></table>";
echo "<table border='1' width='500' height='20'><tr><td><b>Comment:</b>";
echo "<td>" . $row['comment'] . "</td>";
echo "</tr>";
}
}
echo "</table>";
include('bottom.php');
?><br>
</div>
</td>
<!-- END of CONTENT-->

<!--RIGHT MENU-->
<td class='menus' valign='top'>
<font color='#AFAFAF' face='verdana' size='1'>
<CENTER>
<b>Catergory</b><br>
<a href='index.php'>Home</a><br>
<a href='register.php'>Register</a><br>
<a href='login.php'>Login</a><br>
</CENTER>
</td>
</table>
<!--END of RIGHT MENU-->

<!--DISLCLAIMER-->
<table width='750' align="center" cellpadding='4' cellspacing='0' class='disclaimer'>
<tr><td>
<font color='#AFAFAF' face='verdana' size='1'>
<center>
<b>Disclaimer:</b><br>
The Pokémon Trainer's Challenge RPG is © Xyphon, Cless, and other staff members. All Pokémon images are © Nintendo, and The Pokémon Company. We are in no way affiliated with Nintendo, or any of it's affiliates. All programming and content on this site is © to Xyphon. If you steal any of this content, we can fine you.
<br><br>
Layout template by <a href='http://www.nightmarevalley.com' target='_blank'>Valley of Nightmares</a>.
</center>
</table>
<!--END of DISCLAIMER-->
</body>
</html>

Link to comment
Share on other sites

Thats pointless, bottom works on very other code.. But here

 

<?PHP
/* if logged out */
if (!isset($_COOKIE['UserID'])) {
echo "
<br>
</div>
</td>
<!-- END of CONTENT-->

<!--RIGHT MENU-->
<td class='menus' valign='top'>
<font color='#AFAFAF' face='verdana' size='1'>
<CENTER>
<b>Catergory</b><br>
<a href='index.php'>Home</a><br>
<a href='register.php'>Register</a><br>
<a href='login.php'>Login</a><br>
</CENTER>
</td>
</table>
<!--END of RIGHT MENU-->

<!--DISLCLAIMER-->
<table class='disclaimer' cellpadding='4' cellspacing='0' width='750'>
<tr><td>
<font color='#AFAFAF' face='verdana' size='1'>
<center>
<b>Disclaimer:</b><br>
The Pokémon Trainer's Challenge RPG is © Xyphon, Cless, and other staff members. All Pokémon images are © Nintendo, and The Pokémon Company. We are in no way affiliated with Nintendo, or any of it's affiliates. All programming and content on this site is © to Xyphon. If you steal any of this content, we can fine you.
<br><br>
Layout template by <a href='http://www.nightmarevalley.com' target='_blank'>Valley of Nightmares</a>.
</center>
</table>
<!--END of DISCLAIMER-->
</body>
</html>
";
}
if (isset($_COOKIE['UserID'])) {
echo "
<html>
<br>
</div>
</td>
<!-- END of CONTENT-->

<!--RIGHT MENU-->
<td class='menus' valign='top'>
<font color='#AFAFAF' face='verdana' size='1'>
<CENTER>
<b>Catergory</b><br>
<a href=''>Link here</a><br>
<a href=''>Link here</a><br>
<a href=''>Link here</a><br>
<a href=''>Link here</a><br><br>

<b>Catergory</b><br>
<a href=''>Link here</a><br>
<a href=''>Link here</a><br>
<a href=''>Link here</a><br>
<a href=''>Link here</a><br><br>

<b>Catergory</b><br>
<a href=''>Link here</a><br>
<a href=''>Link here</a><br>
<a href=''>Link here</a><br>
<a href=''>Link here</a><br><br>

</CENTER>
</td></tr>
</table>
<!--END of RIGHT MENU-->

<!--DISLCLAIMER-->
<table class='disclaimer' cellpadding='4' cellspacing='0' width='750'>
<tr><td>
<font color='#AFAFAF' face='verdana' size='1'>
<center>
<b>Disclaimer:</b><br>
The Pokémon Trainer's Challenge RPG is © Xyphon, Cless, and other staff members. All Pokémon images are © Nintendo, and The Pokémon Company. We are in no way affiliated with Nintendo, or any of it's affiliates. All programming and content on this site is © to Xyphon. If you steal any of this content, we can fine you.
<br><br>
Layout template by <a href='http://www.nightmarevalley.com' target='_blank'>Valley of Nightmares</a>.
</center>
</table>
<!--END of DISCLAIMER-->

</html>
";
}
?>

Link to comment
Share on other sites

Try loggin in and go to view comments, see if the layout makes a difference, and try it while logged out.

 

 

On your script you have

 

</table>

 

and on bottom.php you have

 

<?PHP

/* if logged out */

if (!isset($_COOKIE['UserID'])) {

echo "

<br>

</div>

</td>

 

Doesnt make sense

 

I ment to take that away.. And </table> Is for the table, duh..

Link to comment
Share on other sites

Same thing.

 

:( Its really sad when the greatest helper, and pro, phpSensei is having trouble fixing it.. XD.. That just shows how horible I really am.

 

lol, I am pro with PHP, just not with html. I am going to examine the HTML and how its affecting the rest of the layout, and post the script in a sec,

 

 

but

 

 

This right here should work 100%

 

<html>
<title> Pokemon Trainer's Challenge RPG </title>

<head>
<style type='text/css'>
A:link { color: #AFAFAF; text-decoration: underline; }
A:visited { color: #AFAFAF; text-decoration: underline; }
A:hover { color: #D0D0D0; text-decoration: none; } 

body 
{
background-color: #000000;
background-image: url('Url here if you have a background image');
scrollbar-face-color: #000000;
scrollbar-highlight-color: #000000;
scrollbar-shadow-color: #000000;
scrollbar-darkshadow-color: #545454;
scrollbar-3d-lightcolor: #545454;
scrollbar-arrow-color: #ffffff;
scrollbar-track-color: #545454;
}

.tables
{ border: 1px solid #252525; background-color: #313131;} 
.menus
{ width: 130px; border: 0px solid #575757; background-color: #313131;} 
.content
{ border: 0px solid #707070; background-color: #4F4F4F;} 
.disclaimer
{ border: 1px solid #252525; background-color: #313131;} 

</style>



</head>


<body>
<div align='center'>
<!--BANNER-->
<table width='750' height='180' align="center" cellpadding='0' cellspacing='0' class='tables'>
<tr><td>
<center>
<font face='verdana' color='#FFFFFF' size='6'><a href='index.php'>
<img border='0' src='http://i3.tinypic.com/7xaet08.jpg'>

</font>
</tr></td>
</table>
<!--END of BANNER-->

<!--LEFT MENU-->
<table width='750' height='250' align="center" cellpadding='4' cellspacing='0' class='tables'>
<tr><td class='menus' valign='top'>
<font color='#AFAFAF' face='verdana' size='1'>
<CENTER>
<b>Catergory</b><br>
<a href='index.php'>Home</a><br>
<a href='register.php'>Register</a><br>
<a href='login.php'>Log in</a><br>
</CENTER>
</td>
<!--END of LEFT MENU-->


<!--CONTENT-->
<td class='content' valign='top'>
<font color='#AFAFAF' face='verdana' size='1'>
<div align='justify'>
<br>
<?PHP
include('Connect.php');
include('top.php');
$result = mysql_query("SELECT * FROM news_comments");

echo "<table border='1'>
<tr>
<th>Hi,<br /> It's Xyphon. I have just made the news page, I hope you like it! Please, leave comments here!</th>
</tr></table>";
echo "<table border='1' width='500'>";
echo "<tr> <td> <a href='postcomment.php'>Post Comment</a></td>";
echo "<td> <a href='viewcomments.php'>View Comments</a></td></tr></table>";

if(mysql_num_rows($result)==0){

echo "There are no current comments. Layout issues may accure.";

}
else
{
while($row = mysql_fetch_array($result)){
echo "<table border='1' width='500' height='20'>";
echo "<br /><br />";
echo "<tr>";
echo "<td><center><b>Username: </b><br />" . $row['username'] .  "</center></td>";
echo "<td><center><b>ID: </b><br />" . $row['user_id'] .  "</center></td></tr></table>";
echo "<table border='1' width='500' height='20'><tr><td><b>Comment:</b>";
echo "<td>" . $row['comment'] . "</td>";
echo "</tr>";
}
}
echo "</table>";
?><br>
</div>
</td>
<!-- END of CONTENT-->

<!--RIGHT MENU-->
<td class='menus' valign='top'>
<font color='#AFAFAF' face='verdana' size='1'>
<CENTER>
<b>Catergory</b><br>
<a href='index.php'>Home</a><br>
<a href='register.php'>Register</a><br>
<a href='login.php'>Login</a><br>
</CENTER>
</td>
</table>
<!--END of RIGHT MENU-->

<!--DISLCLAIMER-->
<table width='750' align="center" cellpadding='4' cellspacing='0' class='disclaimer'>
<tr><td>
<font color='#AFAFAF' face='verdana' size='1'>
<center>
<b>Disclaimer:</b><br>
The Pokémon Trainer's Challenge RPG is © Xyphon, Cless, and other staff members. All Pokémon images are © Nintendo, and The Pokémon Company. We are in no way affiliated with Nintendo, or any of it's affiliates. All programming and content on this site is © to Xyphon. If you steal any of this content, we can fine you.
<br><br>
Layout template by <a href='http://www.nightmarevalley.com' target='_blank'>Valley of Nightmares</a>.
</center>
</table>
<!--END of DISCLAIMER-->
</body>
</html>

Link to comment
Share on other sites

Try loggin in and go to view comments, see if the layout makes a difference, and try it while logged out.

 

 

On your script you have

 

</table>

 

and on bottom.php you have

 

<?PHP

/* if logged out */

if (!isset($_COOKIE['UserID'])) {

echo "

<br>

</div>

</td>

 

Doesnt make sense

 

I ment to take that away.. And </table> Is for the table, duh..

 

No, its because you are ending a table, and your are putting a </td> without the any new <table>

Link to comment
Share on other sites

Try loggin in and go to view comments, see if the layout makes a difference, and try it while logged out.

 

 

On your script you have

 

</table>

 

and on bottom.php you have

 

<?PHP

/* if logged out */

if (!isset($_COOKIE['UserID'])) {

echo "

<br>

</div>

</td>

 

Doesnt make sense

 

I ment to take that away.. And </table> Is for the table, duh..

Wait, how deosnt it? It's checking if they arent logged in, it'll dsiplay it differantly.. And the echo will continue the thing from top.

 

And no, it doesnt. It still messes it up.

 

Also, no, Im not. I ahve </table> After the </td> Then my next </td> is before the next </table> Look over the code.

Link to comment
Share on other sites

Try this on the BOTTOM.php

 

if(isset($_COOKIE['UserID'])){

echo "
<html>
<br>
</div>
</td>
<!-- END of CONTENT-->

<!--RIGHT MENU-->
<td class='menus' valign='top'>
<font color='#AFAFAF' face='verdana' size='1'>
<CENTER>
<b>Catergory</b><br>
<a href=''>Link here</a><br>
<a href=''>Link here</a><br>
<a href=''>Link here</a><br>
<a href=''>Link here</a><br><br>

<b>Catergory</b><br>
<a href=''>Link here</a><br>
<a href=''>Link here</a><br>
<a href=''>Link here</a><br>
<a href=''>Link here</a><br><br>

<b>Catergory</b><br>
<a href=''>Link here</a><br>
<a href=''>Link here</a><br>
<a href=''>Link here</a><br>
<a href=''>Link here</a><br><br>

</CENTER>
</td></tr>
</table>
<!--END of RIGHT MENU-->

<!--DISLCLAIMER-->
<table class='disclaimer' cellpadding='4' cellspacing='0' width='750'>
<tr><td>
<font color='#AFAFAF' face='verdana' size='1'>
<center>
<b>Disclaimer:</b><br>
The Pokémon Trainer's Challenge RPG is © Xyphon, Cless, and other staff members. All Pokémon images are © Nintendo, and The Pokémon Company. We are in no way affiliated with Nintendo, or any of it's affiliates. All programming and content on this site is © to Xyphon. If you steal any of this content, we can fine you.
<br><br>
Layout template by <a href='http://www.nightmarevalley.com' target='_blank'>Valley of Nightmares</a>.
</center>
</table>
<!--END of DISCLAIMER-->

</html>
";

}

else
{

echo '<br>
</div>
</td>
<!-- END of CONTENT-->

<!--RIGHT MENU-->
<td class='menus' valign='top'>
<font color='#AFAFAF' face='verdana' size='1'>
<CENTER>
<b>Catergory</b><br>
<a href='index.php'>Home</a><br>
<a href='register.php'>Register</a><br>
<a href='login.php'>Login</a><br>
</CENTER>
</td>
</table>
<!--END of RIGHT MENU-->

<!--DISLCLAIMER-->
<table width='750' align="center" cellpadding='4' cellspacing='0' class='disclaimer'>
<tr><td>
<font color='#AFAFAF' face='verdana' size='1'>
<center>
<b>Disclaimer:</b><br>
The Pokémon Trainer's Challenge RPG is © Xyphon, Cless, and other staff members. All Pokémon images are © Nintendo, and The Pokémon Company. We are in no way affiliated with Nintendo, or any of it's affiliates. All programming and content on this site is © to Xyphon. If you steal any of this content, we can fine you.
<br><br>
Layout template by <a href='http://www.nightmarevalley.com' target='_blank'>Valley of Nightmares</a>.
</center>
</table>
<!--END of DISCLAIMER-->
</body>
</html>
';
}

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

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.