HELP! Page not loading right!

Discussion in 'HTML & Website Design' started by drhfinegifts, Jul 9, 2006.

  1. #1
    I made some changes to a page to add a rewards program, and now it looks screwy - the right column is way down the page.

    I'm sure I have an extra <tr> or something, I just can't find it!

    The page is at http://www.drhfinegifts.com/account.php

    Login with account email:
    PW: testtest



    Here is the code:

    <table border="0" width="100%" cellspacing="0" cellpadding="0">
    <tr>
    <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
    </tr>
    <tr>
    <td width="100%">
    <table width="100%" bgcolor="#EEEEEE" cellpadding="0" cellspacing="0">
    <tr><td colspan="3" bgcolor="#DDDDDD" width="100%"><img src="images/spacer.gif" border="0" alt="" width="1" height="1"></td></tr>
    <tr>
    <td bgcolor="#DDDDDD"><img src="images/spacer.gif" border="0" alt="" width="1" height="1">
    <td width="100%" class="categoryText"><table cellspacing="3"><tr><td class="infoBoxHeading"><b>&nbsp;&nbsp;:: <?php echo HEADING_TITLE; ?></b></td></tr></table></td>
    <td bgcolor="#DDDDDD"><img src="images/spacer.gif" border="0" alt="" width="1" height="1">
    </tr>
    <tr><td colspan="3" width="100%" class="infoBoxHeadingLine"><img src="images/spacer.gif" border="0" alt="" width="1" height="4"></td></tr>
    </table>
    </td>
    </tr>
    <tr>
    <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '7'); ?></td>
    </tr>
    <?php
    if ($messageStack->size('account') > 0) {
    ?>
    <tr>
    <td><?php echo $messageStack->output('account'); ?></td>
    </tr>
    <tr>
    <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
    </tr>
    <?php
    }

    if (tep_count_customer_orders() > 0) {
    ?>

    <tr>
    <td><table border="0" cellspacing="0" cellpadding="2">
    <tr>
    <td class="main"><b><?php echo OVERVIEW_TITLE; ?></b></td>
    <td class="main"><?php echo '<a href="' . tep_href_link(FILENAME_ACCOUNT_HISTORY, '', 'SSL') . '"><u>' . OVERVIEW_SHOW_ALL_ORDERS . '</u></a>'; ?></td>
    </tr>
    </table></td>
    </tr>

    <tr>
    <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
    <tr class="infoBoxContents">
    <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
    <tr>
    <td class="main" align="middle" valign="top" width="120"><?php echo '<b>' . OVERVIEW_PREVIOUS_ORDERS . '</b>';//<br>' . tep_image(DIR_WS_IMAGES . 'arrow_south_east.gif'); ?></td>
    <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
    <?php
    $orders_query = tep_db_query("select o.orders_id, o.date_purchased, o.delivery_name, o.delivery_country, o.billing_name, o.billing_country, ot.text as order_total, s.orders_status_name from " . TABLE_ORDERS . " o, " . TABLE_ORDERS_TOTAL . " ot, " . TABLE_ORDERS_STATUS . " s where o.customers_id = '" . (int)$customer_id . "' and o.orders_id = ot.orders_id and ot.class = 'ot_total' and o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' order by orders_id desc limit 3");
    while ($orders = tep_db_fetch_array($orders_query)) {
    if (tep_not_null($orders['delivery_name'])) {
    $order_name = $orders['delivery_name'];
    $order_country = $orders['delivery_country'];
    } else {
    $order_name = $orders['billing_name'];
    $order_country = $orders['billing_country'];
    }
    ?>
    <tr class="moduleRow" onMouseOver="rowOverEffect(this)" onMouseOut="rowOutEffect(this)" onClick="document.location.href='<?php echo tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $orders['orders_id'], 'SSL'); ?>'">
    <td class="main" width="80"><?php echo tep_date_short($orders['date_purchased']); ?></td>
    <td class="main"><?php echo '#' . $orders['orders_id']; ?></td>
    <td class="main"><?php echo tep_output_string_protected($order_name) . ', ' . $order_country; ?></td>
    <td class="main"><?php echo $orders['orders_status_name']; ?></td>
    <td class="main" align="right"><?php echo $orders['order_total']; ?></td>
    <td class="main" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $orders['orders_id'], 'SSL') . '">' . tep_image_button('small_view.gif', SMALL_IMAGE_BUTTON_VIEW) . '</a>'; ?></td>
    </tr>
    <?php
    }
    ?>

    <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
    </tr>
    </table></td>
    </tr>
    </table></td>
    </tr>

    <tr>
    <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
    </tr>
    <tr><td background="images/dot_space.gif"><img src="images/spacer.gif" border="0" alt="" width="1" height="1"></tr>
    <tr><td><img src="images/spacer.gif" border="0" alt="" width="1" height="10"></td></tr>
    <tr><td><img src="templates/modern/images/my_account.gif"></td></tr>
    <tr><td><img src="images/spacer.gif" border="0" alt="" width="1" height="10"></td></tr>
    <?php
    }
    ?>



    <tr>
    <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
    <tr class="infoBoxContents">
    <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
    <tr>
    <td><table border="0" width="100%" cellspacing="0" cellpadding="3">
    <tr>
    <td class="infoBoxContents" valign="middle"><img src="images/next.gif">&nbsp;<?php echo ' <a href="' . tep_href_link(FILENAME_ACCOUNT_EDIT, '', 'SSL') . '">' . MY_ACCOUNT_INFORMATION . '</a>'; ?></td>
    </tr>
    <tr>
    <td class="infoBoxContents" valign="middle"><img src="images/next.gif">&nbsp;<?php echo ' <a href="' . tep_href_link(FILENAME_ADDRESS_BOOK, '', 'SSL') . '">' . MY_ACCOUNT_ADDRESS_BOOK . '</a>'; ?></td>
    </tr>
    <tr>
    <td class="infoBoxContents" valign="middle"><img src="images/next.gif">&nbsp;<?php echo ' <a href="' . tep_href_link(FILENAME_ACCOUNT_PASSWORD, '', 'SSL') . '">' . MY_ACCOUNT_PASSWORD . '</a>'; ?></td>
    </tr>
    </table></td>
    <td width="10" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
    </tr>
    </table></td>
    </tr>
    </table></td>
    </tr>
    <tr>
    <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
    </tr>
    <tr><td background="images/dot_space.gif"><img src="images/spacer.gif" border="0" alt="" width="1" height="1"></tr>
    <tr><td><img src="images/spacer.gif" border="0" alt="" width="1" height="10"></td></tr>
    <tr><td><img src="templates/modern/images/my_orders.gif"></td></tr>
    <tr><td><img src="images/spacer.gif" border="0" alt="" width="1" height="10"></td></tr>
    <tr>
    <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
    <tr class="infoBoxContents">
    <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
    <tr>
    <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
    <tr>
    <td class="infoBoxContents" valign="middle"><img src="images/next.gif">&nbsp;<?php echo ' <a href="' . tep_href_link(FILENAME_ACCOUNT_HISTORY, '', 'SSL') . '">' . MY_ORDERS_VIEW . '</a>'; ?></td>
    </tr>
    </table></td>
    <td width="10" align="right"><img src="images/pixel_trans.gif" border="0" alt="" width="10" height="1"></td>
    </tr>
    </table></td>
    </tr>
    </table></td>
    </tr>
    <tr>
    <td><img src="images/pixel_trans.gif" border="0" alt="" width="100%" height="10"></td>
    </tr>
    <tr><td background="images/dot_space.gif"><img src="images/spacer.gif" border="0" alt="" width="1" height="1"></tr> <tr><td><img src="templates/modern/images/email_notifications.gif"></td></tr>
    <tr><td><img src="images/spacer.gif" border="0" alt="" width="1" height="10"></td></tr>
    <tr>
    <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
    <tr class="infoBoxContents">
    <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
    <tr>
    <td><table border="0" width="100%" cellspacing="0" cellpadding="3">
    <tr>
    <td class="infoBoxContents" valign="middle"><img src="images/next.gif">&nbsp;<?php echo ' <a href="' . tep_href_link(FILENAME_ACCOUNT_NEWSLETTERS, '', 'SSL') . '">' . EMAIL_NOTIFICATIONS_NEWSLETTERS . '</a>'; ?></td>
    </tr>
    </table></td>
    <td width="10" align="right"><img src="images/pixel_trans.gif" border="0" alt="" width="10" height="1"></td>
    </tr>
    </table></td>
    </tr>


    <!-- // Points/Rewards Module V2.00 points_system_box_bof //-->
    <?php
    if (USE_POINTS_SYSTEM == 'true') { // check that the points system is enabled
    ?>
    <tr>
    <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
    </tr>
    <tr>
    <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
    <tr>
    <td class="main"><b><?php echo MY_POINTS_TITLE; ?></b></td>
    </tr>
    </table></td>
    </tr>
    <tr>
    <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
    <tr class="infoBoxContents">
    <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
    <tr>
    <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
    <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
    <td><table border="0" width="100%" cellspacing="0" cellpadding="3">
    <?php
    $shopping_points = tep_get_shopping_points();
    if ($shopping_points > 0) {
    ?>
    <tr>
    <td class="main"><?php echo tep_image(DIR_WS_IMAGES . 'next.gif') .'&nbsp;&nbsp;'. sprintf(MY_POINTS_CURRENT_BALANCE, number_format($shopping_points,POINTS_DECIMAL_PLACES),$currencies->format(tep_calc_shopping_pvalue($shopping_points))); ?></td>
    <?php
    }
    ?>
    <tr>
    <td class="infoBoxContents" valign="middle"><?php echo tep_image(DIR_WS_IMAGES . 'next.gif') . ' <a href="' . tep_href_link(FILENAME_MY_POINTS, '', 'SSL') . '">' . MY_POINTS_VIEW . '</a>'; ?></td>
    </tr>
    <tr>
    <td class="infoBoxContents" valign="middle"><?php echo tep_image(DIR_WS_IMAGES . 'next.gif') . ' <a href="' . tep_href_link(FILENAME_MY_POINTS_HELP, '', 'SSL') . '">' . MY_POINTS_VIEW_HELP . '</a>'; ?></td>
    </tr>
    </table></td><tr>
    <td width="10" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
    </tr>
    </table></td>
    </tr>
    </table></td>
    </tr>
    <tr>
    <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
    </tr>
    <?php
    }// else do not show points_system_box
    ?>
    <!-- // Points/Rewards Module V2.00 points_system_box_eof //-->


    Any help will be greatly appreciated!! I have spent way too many hours trying to figure out what was wrong (I'm a PHP novice, so I'm not sure what I am looking for to fix it!)
     
    drhfinegifts, Jul 9, 2006 IP
  2. ahref

    ahref Well-Known Member

    Messages:
    1,123
    Likes Received:
    67
    Best Answers:
    0
    Trophy Points:
    170
    #2
    Too many nested tables, the best way to find error is make border=1 of tables one by one.
     
    ahref, Jul 9, 2006 IP
  3. drhfinegifts

    drhfinegifts Peon

    Messages:
    368
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Okay, if I do that, how will I know what coding is causing the problem?
     
    drhfinegifts, Jul 9, 2006 IP
  4. sketch

    sketch Well-Known Member

    Messages:
    898
    Likes Received:
    26
    Best Answers:
    0
    Trophy Points:
    148
    #4
    Because you'll see which cell is sticking out incorrectly and you should at the least be able to narrow down where that piece of code is by what's in the cell or neighboring cells.
     
    sketch, Jul 9, 2006 IP
  5. ahref

    ahref Well-Known Member

    Messages:
    1,123
    Likes Received:
    67
    Best Answers:
    0
    Trophy Points:
    170
    #5
    Exactly what sketch said, you will be able to found that which table is causing error.
     
    ahref, Jul 10, 2006 IP
  6. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #6
    The validator shows several tr tags where they're not allowed, among the 240+ errors.

    cheers,

    gary
     
    kk5st, Jul 10, 2006 IP
  7. ccoonen

    ccoonen Well-Known Member

    Messages:
    1,606
    Likes Received:
    71
    Best Answers:
    0
    Trophy Points:
    160
    #7
    If your running Dreamweaver, it can "Fix" invalid HTML to a point. I would give that a try... but soo many nested tables can be hard to fix. Set different background colors to different Tables to see what is what.
     
    ccoonen, Jul 11, 2006 IP