Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Mar 2007
    Location
    Quebec
    Posts
    261
    Thanks
    6
    Thanked 7 Times in 7 Posts

    PHP generated table causing panel to be screwy

    Hi,

    On my site, I've got one problematic page (so far). There is supposed to be an automatically generated table with all the users of the site contained in it. I used PHP for that, but I don't think the script is the problem.

    When the page loads, the right side panel gets all out of alignment, and its only for that one page. All the rest are fine.

    View page at: www.mtbhu.com/flaw/index.php?page=members

    Here is the CSS I used:
    Code:
    html, body {
    min-height:100%;
    background:#000000;
               }
    
     a img {
     border:0;
     vertical-align:bottom;
      padding:0px;
      display:inline;
             }
    
    .container {
    margin:0 auto;
    clear:both;
    width:950px;
    height:1100px;
    color:#000000;
    font-family:Verdana, Times New Roman, Arial;
    font-size:12px;
                }           
    
    #header {
    margin:0 auto;
    width:950px;
    height:159px;
             }
    
    #navbar {
    margin:0 auto;
    width:950px;
    height:34px;
            }
    
    #lpanel {
    background: url('/flaw/images/panel_left.gif');
    width:239px;
    height:906px;
    margin:0 auto;
    float:left;
             }
    
    #content {
    margin:0 auto;
    float:left;
    background:#CCCCCC;
    width:472px;
    height:906px;
             }
    
    #contentTxt{
    width:452px;
    height:984px;
    }
    
    #contentTxt th {
    font-size:14px;
    }
    
    #contentTxt td {
    font-size:12px;
    }
    
    #rpanel {
    background: url('/flaw/images/panel_right.gif');
    width:238px;
    height:906px;
    margin:0 auto;
    float:right;
             }
    This is the PHP code for the table, although I don't think it is the problem.
    PHP Code:
    <?php 
    include("/home/conbin/public_html/php/config.php");
    $connect mysql_connect("$host","$user","$passwd");
    if(!
    $connect)
      {
      die(
    "Could not connect: " .mysql_error());
      }
      
     
    //select database
     
    mysql_select_db("$dbname"$connect);

    $table_name "members"//insert table name here
     
    $return mysql_query("SELECT * FROM $table_name"); //get value from members 
     
     
    echo "<table border='1' width='400' style='font-size:12px;' align='center'>
     <tr>
     <th>Username</th>
      <th>Location</th>
     <th>Xfire</th>
     <th>MSN</th>
     <th>Join Date</th>
     "
    ;
     
     while(
    $row mysql_fetch_array($return))
      {
    //output data in table
    echo "<tr>";
    echo 
    "<td>" $row['user_name'] ."</td>";
    echo 
    "<td>" .$row['location'] ."</td>";
    echo 
    "<td>" .$row['xfire'] ."</td>";
    echo 
    "<td>" .$row['msn'] ."</td>";
    echo 
    "<td>" .$row['create_date'] ."</td>";
    echo 
    "</tr>";
      }
    ?>
    Generated HTML:
    Code:
               <html>
    <head>
    <title>*Flaw >> Where the Real Fun Begins*</title>
    <style>
    html, body {
    min-height:100%;
    background:#000000;
               }
    
     a img {
     border:0;
     vertical-align:bottom;
      padding:0px;
      display:inline;
             }
    
    .container {
    margin:0 auto;
    clear:both;
    width:950px;
    height:1100px;
    color:#000000;
    font-family:Verdana, Times New Roman, Arial;
    font-size:12px;
                }           
    
    #header {
    margin:0 auto;
    width:950px;
    height:159px;
             }
    
    #navbar {
    margin:0 auto;
    width:950px;
    height:34px;
            }
    
    #lpanel {
    background: url('/flaw/images/panel_left.gif');
    width:239px;
    height:906px;
    margin:0 auto;
    float:left;
             }
    
    #content {
    margin:0 auto;
    float:left;
    background:#CCCCCC;
    width:472px;
    height:906px;
             }
    
    #contentTxt{
    padding:20px;
    }
    
    #contentTxt th {
    font-size:14px;
    }
    
    #contentTxt td {
    font-size:12px;
    }
    
    #rpanel {
    background: url('/flaw/images/panel_right.gif');
    width:238px;
    height:906px;
    margin:0 auto;
    float:right;
             }
    
    </style>
    </head>
    <body>
    	<div class="container">
    		<div id="header"><img src="/flaw/images/index_01.gif"></div>
    		<div id="navbar"><a href='/flaw/'><img src='/flaw/images/nav_home.gif'></a><a href='/flaw/index.php?page=news'><img src='/flaw/images/nav_news.gif'></a><a href='/flaw/index.php?page=members'><img src='/flaw/images/nav_roster.gif'></a><a href='/flaw/index.php?page=downloads'><img src='/flaw/images/nav_downloads.gif'></a><a href='http://www.flawclan.com/' target='_blank'><img src='/flaw/images/nav_forum.gif'></a><a href='/flaw/index.php?page=server'><img src='/flaw/images/nav_server.gif'></a><a href='/flaw/index.php?page=contact'><img src='/flaw/images/nav_contact.gif'></a><a href='/flaw/index.php?page=about'><img src='/flaw/images/nav_about.gif'></a></div>
    		<div id="lpanel"></div>
    
    		<div id="content">
    		<div id="contentTxt">
    		<table border='1' width='300' align='center'>
     <tr>
     <th>Username</th>
     <th>Location</th>
     <th>Xfire</th>
    
     <th>MSN</th>
     <th>Join Date</th>
     <tr><td>Test</td><td>Test City</td><td>
    									Test Xfire</td><td>Test MSN</td><td>2007-07-07</td></tr>	    </div>
    	    </div>
    
    		<div id="rpanel"></div>
    		
    	</div>
    </body>
    </html>
    Any idea's? I'm out of them for the moment =/

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Well validating your page shows you have some errors that are likely causing the issue. Having a doctype will also help.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #3
    Regular Coder BWiz's Avatar
    Join Date
    Mar 2006
    Location
    Sol System
    Posts
    471
    Thanks
    7
    Thanked 21 Times in 21 Posts
    This is your generated table.

    Code:
    <table border='1' width='400' style='font-size:12px;' align='center'>
     <tr>
     <th>Username</th>
      <th>Location</th>
     <th>Xfire</th>
    
     <th>MSN</th>
     <th>Join Date</th>
     <tr><td>Test</td><td>Test City</td><td>
    									Test Xfire</td><td>Test MSN</td><td>2007-07-07</td></tr></table><tr><td>Padapwn</td><td>You Wish ;)</td><td>
    
    									-</td><td>powerbomb360@hotmail.com</td><td>2007-07-08</td></tr></table>
    I believe this is what it should be generated as:

    Code:
    <table border='1' width='400' style='font-size:12px;' align='center'>
     <tr>
      <th>Username</th>
      <th>Location</th>
      <th>Xfire</th>
      <th>MSN</th>
      <th>Join Date</th>
     </tr>
      <tr>
       <td>Test</td>
       <td>Test City</td>
       <td>Test Xfire</td>
       <td>TestMSN</td>
       <td>2007-07-07</td>
     </tr>
    </table>
     <tr>
      <td>Padapwn</td>
      <td>You Wish ;)</td>
      <td> -</td>
      <td>powerbomb360@hotmail.com</td>
      <td>2007-07-08</td>
     </tr>
    </table>
    The red means it should be there, the blue means it shouldn't.

    Also, I don't see your right column out of alignement at all.
    BWiz :: Happy Coding!
    2006
    2007 2008 2009
    2010 2011
    Irrational numbers make no sense.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •