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 4 of 4

Thread: Pages

  1. #1
    Regular Coder
    Join Date
    Jun 2009
    Posts
    278
    Thanks
    78
    Thanked 2 Times in 2 Posts

    Pages

    In my site I need to make a list, but I also need it to create a page for every 5 items on the list. For an example, it would be similar to a forum section, like when theres 20 topics posted, a new page is made. How could this be done?
    I know I didnt give alot of info, so if you need any more info jsut ask.

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,855
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Blog Entries
    1
    It's known as pagination. Search for PHP+mysql+pagination if you are using these items.
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • Users who have thanked abduraooft for this post:

    Ndogg (07-21-2009)

  • #3
    Regular Coder
    Join Date
    Jun 2009
    Posts
    278
    Thanks
    78
    Thanked 2 Times in 2 Posts
    Thanks now Im on the right track, but Im having issues, I got this guide on how to add it but with this, switching between pages doesnt work. It only stays on page one...

    Heres the Pages script:

    PHP Code:
    // First we check if we are on page one. If we are then we don't need a link to the previous page or the first page so we do nothing. If we aren't then we generate links to the first page, and to the previous page.
    if ($pagenum == 1
    {

    else 
    {
    echo 
    " <a href='{$_SERVER['PHP_SELF']}?pagenum=1'> <<-First</a> ";
    echo 
    " ";
    $previous $pagenum-1;
    echo 
    " <a href='{$_SERVER['PHP_SELF']}?pagenum=$previous'> <-Previous</a> ";


    //just a spacer
    echo " ---- ";

    //This does the same as above, only checking if we are on the last page, and then generating the Next and Last links
    if ($pagenum == $last
    {

    else {
    $next $pagenum+1;
    echo 
    " <a href='{$_SERVER['PHP_SELF']}?pagenum=$next'>Next -></a> ";
    echo 
    " ";
    echo 
    " <a href='{$_SERVER['PHP_SELF']}?pagenum=$last'>Last ->></a> ";

    If this isnt enough, all psot the whole code...


    Edit: I jsut realized that when clicking next, it goes to page 2 but the info stays the same, after that it doesnt go to pg3, when clicking last pg it goes to the last page.

    Also, it doesnt display the previous page button, so it must be something with the page number stuff?
    Last edited by Ndogg; 07-21-2009 at 10:23 AM.

  • #4
    Banned
    Join Date
    Jul 2009
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Pages

    It has never been easier to create web pages. Just a couple of years ago, you need to have pretty good knowledge of website authoring skills to even create a decent web page. You need to learn programming language such as HTML to start. And even so, you probably spend a lot of time trying to debug your web page. You spend a lot of time because there are no available tool that can help you with the website creation process.

    Today, it is so much easier. If you just want a simple blog, it can be done easily with tools that are readily available. You can easily find websites that allow you to create web pages for zero cost base on some standard template. These sites typically allow you to upload the standard media such as sound clips, movie, pictures etc. However, as you begin to get excited and want to do more, such websites may start charging you for the usage.


  •  

    Posting Permissions

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