#1
  1. No Profile Picture
    smc
    Registered User
    SEO Chat Explorer (0 - 99 posts)

    Join Date
    Nov 2012
    Posts
    5
    Rep Power
    0

    Displaying 2 columns in my PHP scripting


    Need to create a 2 column output page. Currently I have a working 1 column page you can see here: freeskateboardsticker.com/news/authors.php

    The script is here:

    <?php include_once(realpath("templates/top.php")); ?>
    <?php include_once(realpath("templates/$templates/mid1.php")); ?>

    <?php

    $page = @$_GET["page"];
    $start = @$_GET["start"];

    if(!is_numeric($page) || $page < 1)
    $page = 1;

    if($page == 1)
    $start = 0;
    else
    $start = ($page * $authorsPerPage) - $authorsPerPage;

    $aResult = mysql_query("select pk_alId, alEmail, alFName, alLName, alBio, alDateJoined from tbl_AdminLogins order by alFName, alLName limit $start, $authorsPerPage");
    $numRows = mysql_num_rows(mysql_query("select pk_alId from tbl_AdminLogins order by alFName, alLName"));
    if($numRows > 0)
    {
    ?>
    <!-- Start Authors -->


    <div align="center">
    <center>
    <table width="86%" border="0" cellspacing="0" cellpadding="0">
    <tr>
    <td width="100%" colspan="2" class="BodyHeader2">
    <span class="BodyHeading">
    <br><?php echo $siteName; ?> Authors
    </span>
    </tr>
    <tr>
    <td width="100%" height="20" colspan="2" align="right" valign="top">
    <?php

    if($page > 1)
    $nav .= "<a href='authors.php?page=" . ($page-1) . "'><u> Prev</u></a> | ";

    for($i = 1; $i <= ceil($numRows / $authorsPerPage); $i++)
    if($i == $page)
    $nav .= "<a href='authors.php?page=$i'><b>$i</b></a> | ";
    else
    $nav .= "<a href='authors.php?page=$i'>$i</a> | ";

    if(($start+$authorsPerPage) < $numRows && $numRows > 0)
    $nav .= "<a href='authors.php?page=" . ($page+1) . "'><u>Next </u></a>";

    if(substr(strrev($nav), 0, 2) == " |")
    $nav = substr($nav, 0, strlen($nav)-2);

    echo $nav . "<br>&nbsp;";
    ?>
    </td>
    </tr>
    </table>
    <div align="center">
    <center>
    <table cellpadding="0" border="0">
    <?php while ($aRow = mysql_fetch_array($aResult)) { ?>
    <tr>
    <td> <?php if ($showAuthorImages) { ?><img src="imageview.php?what=getAuthorPic&authorId=<?ph p echo $aRow["pk_alId"]; ?>">&nbsp;<?php } ?></td>
    <td> </td>
    <td><span class="BodyHeading1"><?PHP echo $aRow["alFName"]; ?></span>
    <br><span class="Text1"><?php echo $aRow["alBio"]; ?></span><br>
    <br><span class="BodyHeading3"> <a href="<?php echo $aRow["alEmail"]; ?>"><?php echo $aRow["alEmail"]; ?><img src="imageview.php?imageId=4"
    border="0"></a><br></span></td>
    </tr>
    <tr>
    <td colspan="3"> </td>
    </tr>
    <?php } ?>
    </table>
    </center>
    </div>

    <div align="center">
    <center>
    <table width="96%" border="0" cellspacing="0" cellpadding="0">
    <tr>
    <td width="100%" height="20" colspan="2" align="right" valign="top">
    <span class="Text4"><?php echo $nav . "<br>&nbsp;"; ?></span>
    <br>&nbsp;
    </td>
    </tr>
    </table>
    </center>
    </div>
    <!-- End Authors -->
    <?php
    }
    else
    {
    // No authors found in the database
    ?>
    <!-- StartAuthors -->

    <!-- End Authors -->
    <?php
    }
    ?>

    <div align="center">
    <center>
    <table width="96%" border="0" cellspacing="0" cellpadding="0">
    <tr>
    <td width="100%" height="20" colspan="2" align="right" valign="top">
    <?php echo $nav . "<br>&nbsp;"; ?>
    <br>&nbsp;
    </td>
    </tr>
    </table>
    </center>
    </div>

    <?php include_once(realpath("templates/bottom.php")); ?>
  2. #2
  3. SEO Insultant
    SEO Chat Mastermind (5000+ posts)

    Join Date
    Oct 2005
    Location
    sharing a room with my ego
    Posts
    5,802
    Rep Power
    1798
    What are we to say about this?
  4. #3
  5. No Profile Picture
    smc
    Registered User
    SEO Chat Explorer (0 - 99 posts)

    Join Date
    Nov 2012
    Posts
    5
    Rep Power
    0
    Originally Posted by dzine
    What are we to say about this?
    Need to create a 2 column output page. Currently I have a working 1 column page that is limited to 10 entries per page.

    Which is the script above.
  6. #4
  7. SEO Insultant
    SEO Chat Mastermind (5000+ posts)

    Join Date
    Oct 2005
    Location
    sharing a room with my ego
    Posts
    5,802
    Rep Power
    1798
    Yes, but it is cluttered with irrelevant php code, or maybe even relevant php (we cannot tell). Why not search the web for a tried and tested 2 column template?

    Also, you've posted this in the SEO Scripts section, but it has nothing whatsoever to do with SEO. Did you really sign up here (=a SEO forum) to ask this question about web design?
  8. #5
  9. No Profile Picture
    smc
    Registered User
    SEO Chat Explorer (0 - 99 posts)

    Join Date
    Nov 2012
    Posts
    5
    Rep Power
    0
    Originally Posted by dzine
    Yes, but it is cluttered with irrelevant php code, or maybe even relevant php (we cannot tell). Why not search the web for a tried and tested 2 column template?

    Also, you've posted this in the SEO Scripts section, but it has nothing whatsoever to do with SEO. Did you really sign up here (=a SEO forum) to ask this question about web design?
    Actually, doing a web search for such an answer is what brought me here. forums.seochat.com/ seo-scripts-10/ building-a-table-with-php-how-to-do-two-columns-187040.html
  10. #6
  11. No Profile Picture
    smc
    Registered User
    SEO Chat Explorer (0 - 99 posts)

    Join Date
    Nov 2012
    Posts
    5
    Rep Power
    0
    Originally Posted by smc
    Actually, doing a web search for such an answer is what brought me here. forums.seochat.com/ seo-scripts-10/ building-a-table-with-php-how-to-do-two-columns-187040.html

    If I posted to the wrong forum, my apologies.
  12. #7
  13. SEO Insultant
    SEO Chat Mastermind (5000+ posts)

    Join Date
    Oct 2005
    Location
    sharing a room with my ego
    Posts
    5,802
    Rep Power
    1798
    Ah, in that case I understand

    Just know that there are few real web design specialists here, and showing all your php code here isn't helping really.

    I do hope somebody will chime in to help you out.
  14. #8
  15. No Profile Picture
    smc
    Registered User
    SEO Chat Explorer (0 - 99 posts)

    Join Date
    Nov 2012
    Posts
    5
    Rep Power
    0
    Originally Posted by dzine
    Ah, in that case I understand

    Just know that there are few real web design specialists here, and showing all your php code here isn't helping really.

    I do hope somebody will chime in to help you out.
    Thank you.

Similar Threads

  1. Site coding and the extention use - help
    By jrothra in forum SEO Help (General Chat)
    Replies: 14
    Last Post: Aug 10th, 2005, 02:30 PM
  2. Spaces displaying incorrectly on PHP page
    By Srivvy in forum Web Design, Coding and Programming
    Replies: 1
    Last Post: Jul 24th, 2005, 06:23 PM
  3. how to 301 redirect dynamic PHP pages.
    By wannabrich in forum Google Optimization
    Replies: 6
    Last Post: Jun 9th, 2005, 11:38 PM
  4. php or htm
    By Steve W in forum Google Optimization
    Replies: 3
    Last Post: Mar 23rd, 2005, 12:43 AM
  5. Apache & PHP Help(Linux Guru Please)
    By luxurysleep in forum Web Design, Coding and Programming
    Replies: 5
    Last Post: Jan 4th, 2005, 10:34 AM

IMN logo majestic logo threadwatch logo seochat tools logo