Results 1 to 3 of 3

Thread: How to add next/ prev page function

  1. #1
    Join Date
    Jan 2007
    Location
    Bournemouth, England
    Posts
    99
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default How to add next/ prev page function

    I found a news posting script thats perfect in every way apart from the fact it does not have a previous/ next link function. It is flat-file based and saves each article in a new html document. here is the php code for the page where i'd want the prev next buttons to be.
    PHP Code:
    <?

            
    require('config.php'); 

        
    $filename "article_summary.html";

        
    #- open article summaries
        
    if(file_exists($filename)){
            
    $fh fopen($filename"r");
            
    $old_news fread($fhfilesize($filename));
            
    fclose($fh);
        }

     
        
    #- get first five article
        
    $articles explode("<!--ARTICLE-->"$old_news);

        
    $i=0;
        foreach ( 
    $articles as $article ){
            if(
    count($articles)>$i){
                if(
    $max_latest >= $i++){
                    print 
    $article;
                }
            }
        }

    ?>
    I have it installed at http://www.killerchutney.co.uk/contentbeta/latest.php
    Please help, thanks.

  2. #2
    Join Date
    Jul 2006
    Location
    just north of Boston, MA
    Posts
    1,806
    Thanks
    13
    Thanked 72 Times in 72 Posts

    Default

    you are talking about pagination

  3. #3
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

Bookmarks

Posting Permissions

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