Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2004
    Northpole :)

    makes anotehr page automatically?

    Can anyone write me a basic script that breaks a certain page of information into many pages.

    Like if I have a long long page of text. I want it so when user put in their article, it automatically breaks into another page when it reach a certain number of articles posted on one page, and display the link to page 2, page 3 etc.

    Can anyone give me a script that does that?


  2. #2
    Join Date
    Oct 2003
    with php and mysql you can do it pretty easily

    something like this would post 10 per page

    $start = intval($_GET['start']);
    $amount_per_page = 10;
    $result = mysql_query("SELECT * FROM my_table ORDER BY article_date DESC LIMIT $start,$amount");
    // output the contents of the last 10 articles

    $total_pages = ceil(mysql_num_rows($result) / $amount_per_page);
    //displace the links starting from page 2
    for ($i = 1; $i <= $total_pages; $i++) {
    echo "<a href="index.php?start=" . $i * $amount_per_page . ">$i</a>";

    just a general idea on how you can implement it

Posting Permissions

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