ghqwerty Posted October 3, 2008 Share Posted October 3, 2008 my table is going all screwy and ive been looking for the last 10 mins but can see any extra or any less html tags help <html> <head> </head> <body bgcolor="#ffffcc"> <table name="shell" height="99%" width="99%" border="1"> <tr > <td colspan="3" height="15%"> <center> <h1> _-_Bliss wars_-_ </h1> </center> </td> </tr> <tr> <td width="10%"> <?php require("links.php");?> </td> <td with="80%"> <center> <br /> <br /> <br /> <?php $max = 20; //amount of users per page. change to what you want $users = $_GET['users']; if(empty($users)) { $users = 1; } $limits = ($users - 1) * $max; //view the users if(isset($_GET['items']) && $_GET['items'] == "view"){ $id = $_GET['id']; $sql = mysql_query("SELECT * FROM members"); while($r = mysql_fetch_array($sql)){ $id = $r['id']; $user = $r['username']; $rank = $r['rank']; echo "<div><p>$id</p><p>$user</p><p>$rank</p></div>"; } }else{ //view all the users $sql = mysql_query("SELECT * FROM members LIMIT ".$limits.",$max") or die(mysql_error()); //the total rows in the table $totalres = mysql_result(mysql_query("SELECT COUNT(id) AS tot FROM members"),0); //the total number of pages (calculated result), math stuff... $totalpages = ceil($totalres / $max); //the table echo " <table id='inventory' height='20%' width='35%' border='1'> <tr> <td colspan='3'> <center> users </center> </td> </tr> <tr> <td width='25%'> <center> userid </center> </td> <td width='45%' > <center> username </center> </td> <td width='30%'> <center> rank </center> </td> </tr>"; if($totalres < 1){ echo "<tr><td colspan=\"3\"><center>Where'd everyone go !!!<center></td></tr></table>"; }else{ while($r = mysql_fetch_array($sql)){ $id = $r['id']; $user = $r['username']; $rank = $r['rank']; echo " <tr> <td width='25%'> <center> ".$id." </center> </td> <td width=\"45%\"> <center> ".$user." </center> </td> <td width=\"30$\"> <center> ".$rank." </center> </td> </tr> "; } $prev_page = $users - 1; echo "<tr><td colspan='3'>"; if($prev_page >= 1){ echo "<b><< <a href=users.php?users=$prev_page>Prev.</a></b>"; } if($totalpages <= 3){ //this is the pagination link for($i = 1; $i <= $totalpages; $i++){ echo "<a href='users.php?users=$i'> $i </a>| "; } }else{ $twobefore = $users-2; $onebefore = $users-1; $oneafter = $users+1; $twoafter = $users+2; if($twobefore >= 1){ echo "<a href=users.php?users=$twobefore> $twobefore </a>"; if($onebefore >= 1){ echo "<a href=users.php?users=$onebefore> $onebefore </a>"; echo "<a href=users.php?users=$user> $user </a>"; if($oneafter <= $totalpages){ echo "<a href=users.php?users=$oneafter> $oneafter </a>"; if($twoafter <= $totalpages){ echo "<a href=users.php?users=$twoafter> $twoafter </a>"; if($twoafter < totalpages){ echo "...<a href=users.php?users=$totalpages> $totalpages </a>"; } } } } } $next_page = $users + 1; if($next_page <= $totalpages) { echo"<a href=inventory.php?users=$next_page><b>Next</b></a> <b>>></b>"; } echo "</td></tr>"; //close up the table echo "</table>"; } } } ?> </center> </td> <td width="10%"> <?php require("links.php");?> </td> </tr> </table> </body> </html> Quote Link to comment https://forums.phpfreaks.com/topic/126908-arr-mine-eyes/ Share on other sites More sharing options...
F1Fan Posted October 3, 2008 Share Posted October 3, 2008 Looks fine to me. Where are you seeing issues? Quote Link to comment https://forums.phpfreaks.com/topic/126908-arr-mine-eyes/#findComment-656407 Share on other sites More sharing options...
ghqwerty Posted October 3, 2008 Author Share Posted October 3, 2008 if you boot it up in a localhost or something youll see basically the left hand side navigation is merging with the cetner table for the users :S Quote Link to comment https://forums.phpfreaks.com/topic/126908-arr-mine-eyes/#findComment-656409 Share on other sites More sharing options...
F1Fan Posted October 3, 2008 Share Posted October 3, 2008 List that links.php code. Maybe it's something in there. Quote Link to comment https://forums.phpfreaks.com/topic/126908-arr-mine-eyes/#findComment-656412 Share on other sites More sharing options...
ghqwerty Posted October 3, 2008 Author Share Posted October 3, 2008 <a href="home.php.php" target="_top">Home</a> <br> <a href="stats.php" target="_top">Stats</a> <br> <a href="page1.php" target="_top">Slots</a> <br /> <a href="bank.php" target="_top">bank</a> <br /> <a href="extortion.php" target="_top">extortion</a> <br /> <a href="inventory.php" target="_top">inventory</a> <br /> <a href="users.php" target="_top">users</a> <br /> <a href="checklogin.php" target="_top">logout</a> cant see anything wrong with that i have a page very similiar to this that works fine :S Quote Link to comment https://forums.phpfreaks.com/topic/126908-arr-mine-eyes/#findComment-656413 Share on other sites More sharing options...
F1Fan Posted October 3, 2008 Share Posted October 3, 2008 Well, the only thing I see I doubt would cause any problems: echo "<tr><td colspan=\"3\"><center>Where'd everyone go !!!<center></td></tr></table>"; Missing / for the close center tag. Could you list the page source after it's loaded? Quote Link to comment https://forums.phpfreaks.com/topic/126908-arr-mine-eyes/#findComment-656416 Share on other sites More sharing options...
ghqwerty Posted October 3, 2008 Author Share Posted October 3, 2008 thanks for the spot but still no change heres the source <html> <head> </head> <body bgcolor="#ffffcc"> <table name="shell" height="99%" width="99%" border="1"> <tr > <td colspan="3" height="15%"> <center> <h1> _-_Bliss wars_-_ </h1> </center> </td> </tr> <tr> <td width="10%"> <a href="home.php.php" target="_top">Home</a> <br> <a href="stats.php" target="_top">Stats</a> <br> <a href="page1.php" target="_top">Slots</a> <br /> <a href="bank.php" target="_top">bank</a> <br /> <a href="extortion.php" target="_top">extortion</a> <br /> <a href="inventory.php" target="_top">inventory</a> <br /> <a href="users.php" target="_top">users</a> <br /> <a href="checklogin.php" target="_top">logout</a> </td> <td width="80%"> <center> <br /> <br /> <br /> <table id='users' height='20%' width='35%' border='1'> <tr> <td colspan='3'> <center> users </center> </td> </tr> <tr> <td width='25%'> <center> userid </center> </td> <td width='45%' > <center> username </center> </td> <td width='30%'> <center> rank </center> </td> </tr> <tr> <td width='25%'> <center> 1 </center> </td> <td width="45%"> <center> matty </center> </td> <td width="30%"> <center> 100 </center> </td> </tr> <tr> <td width='25%'> <center> 11 </center> </td> <td width="45%"> <center> whisky </center> </td> <td width="30%"> <center> 100 </center> </td> </tr> <tr> <td width='25%'> <center> 12 </center> </td> <td width="45%"> <center> james </center> </td> <td width="30%"> <center> 10 </center> </td> </tr> <tr> <td width='25%'> <center> 13 </center> </td> <td width="45%"> <center> brandy </center> </td> <td width="30%"> <center> 10 </center> </td> </tr> <tr> <td width='25%'> <center> 14 </center> </td> <td width="45%"> <center> ghqwerty </center> </td> <td width="30%"> <center> 10 </center> </td> </tr> <tr> <td width='25%'> <center> 15 </center> </td> <td width="45%"> <center> guinness </center> </td> <td width="30%"> <center> 0 </center> </td> </tr> <tr><td colspan='2'><a href='users.php?users=1'> 1 </a>| </center> </td> <td width="10%"> <a href="home.php.php" target="_top">Home</a> <br> <a href="stats.php" target="_top">Stats</a> <br> <a href="page1.php" target="_top">Slots</a> <br /> <a href="bank.php" target="_top">bank</a> <br /> <a href="extortion.php" target="_top">extortion</a> <br /> <a href="inventory.php" target="_top">inventory</a> <br /> <a href="users.php" target="_top">users</a> <br /> <a href="checklogin.php" target="_top">logout</a> </td> </tr> </table> </body> </html> Quote Link to comment https://forums.phpfreaks.com/topic/126908-arr-mine-eyes/#findComment-656420 Share on other sites More sharing options...
Brian W Posted October 3, 2008 Share Posted October 3, 2008 I'd like to look at it but I don't know how. I opened it in dreamweaver to see what I could do with it. I made links.php included, not required, because I don't actually have links.php... I also can't see your user table because I don't have access to your database... So, not much help from that direction. Can you take a screen shot or give us a link? Quote Link to comment https://forums.phpfreaks.com/topic/126908-arr-mine-eyes/#findComment-656421 Share on other sites More sharing options...
F1Fan Posted October 3, 2008 Share Posted October 3, 2008 BINGO! Your close table tag: echo "</td></tr>"; //close up the table echo "</table>"; is inside an if/else statement. Move it out of that ELSE. Quote Link to comment https://forums.phpfreaks.com/topic/126908-arr-mine-eyes/#findComment-656422 Share on other sites More sharing options...
ghqwerty Posted October 3, 2008 Author Share Posted October 3, 2008 ahh thanks i just saw that i mnested it in the wrong one i wouldnt of spotted it without seeing the source so thanks for the tip Quote Link to comment https://forums.phpfreaks.com/topic/126908-arr-mine-eyes/#findComment-656423 Share on other sites More sharing options...
Brian W Posted October 3, 2008 Share Posted October 3, 2008 Damn, he beat me to the punch. Also, your center tags seem to be having an issue. The ones I'm speaking of are the ones that open on line 20. Possibly use <div align="center"></div> instead. But if everything is showing up okay, that don't worry about it. Quote Link to comment https://forums.phpfreaks.com/topic/126908-arr-mine-eyes/#findComment-656425 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.