Free php scripts


WM Media - Sell Your Website Social Bookmarking
WL Marketing - a SEO Submission Company
Article Submission
  • Register
  • Login


  • Tutorials/support/References
  • PHP/ASP/PERL Bookstore
  • Community
  • Chat
  • Tutorials
  • Free Smiley Icons
  • Web Hosting

  • Search


    Scripts
  • Chipmunk CMS
  • Forums PHP Script
  • Chipmunk Blogger Script
  • Chipmunk Topsites
  • Chipmunk Addresshost
  • Chipmunk Newsletter
  • Free Guestbook Script
  • Free Poll Script
  • Directory Script
  • Kill Monster
  • Free FFAL script
  • CMS core
  • Chat Room
  • Riddles
  • Random Links
  • Recommend Site
  • Random Quote
  • Story Lines
  • Text Counter
  • Chipmunk Live
  • Chipmunk Bloghost
  • PHP AWS script
  • pwngame
  • Books
  • Begginning PHP4
  • Professional PHP4
  • PHP Cookbook
  • Legal Stuff for scripts
  • Script Liscense


  • Top 5 hottest members
    canuckid
    Mitch
    Decenco
    Tanya
    Chipmunk


    Top 5 links
    RankSite title
    #1Hacked By SiLeNT
    #2Hacked By SiLeNT
    #3Hacked By SiLeNT
    #4Hacked By SiLeNT
    #5Hacked By SiLeNT
    Add your site


    Quality Freelancing


    Sister Sites
  • My Blog
  • Albino Freebies
  • Java gaming
  • Flashninjaclan


  • Premium Affiliates
     
     
    Page Numbers Tutorial
    This simple tutorial with show you how to display page navigation links with php/mysql much like the page navigation on chipmunk guestbook.
    Okay once again like on all my other tutorials, the code comes first.

    <? $numentries=10;
    //declares number of entries per page to display
    global $start;
    //declares start as a global variable
    if(!isset($start))
      {
        $start=0;
        //if start is not set, set it to zero
      }
    $newselect="Select * FROM table order by EntryID DESC LIMIT $start,$numentries";
    //selects entries from start to number of entires after start
    $newsquery=mysql_query($newselect) or die("dies");
    while($news=mysql_fetch_array($newsquery))
      {
       print "$news[field]";
      }
    $d=0;
    $f=0;
    $g=1; //we use these three variables to keep track of counts
    $r="SELECT*from table";
    $r2=mysql_query($r);
    while($order3=mysql_fetch_array($r2))
    {
      if($f%$numentries==0)
      {
        print "<A href='index.php?start=$d'>$g</a> ";
    $g++;   }
      $d=$d+1;
      $f++;
    }
    ?>



    I know that was alot of code but I'll try ro explain it right here.
    First off, I declared the number of entries I wanted to display per page at the top.
    Then I declared my $start variable, which will be the variable I use to keep track what the number of the first entry on a page is. Start must be declared as a global.
    The next if statement says that is start isn't set in the browser URL, set start to zero or page 1
    Next we retrieve entries from what is defined in the brower URL as $start to however many entries we specified at numentries at the top of the code.
    The while loop just prints out whatever the text is for those entries on the page we selected.
    Next we declare d,f as variables and set them both to zero, I'll exaplain these as I explain the next loop, just know that they are needed.
    Okay, now here's the hard part, the loop that actually displays the navigation.
    First we select all the entries in that table, query it and convert it into the array. Now while there is an entry(this means for all entries in the array) this while loop runs.
    The next line says that if the remainder of f divided by the number is zero, print a hyperlink with start set at $d. In the first case, it will print out a one, which means start is at zero, if you click on it, it just reloads the first page.
    However, the f%numentires command tells it only to print another number when it equals zero so that means for it to print out a page 2 in the navigation, there must be more than $numentires entries in the sql table.
    d increments each time so every time it print out a different number d will be a multiple of $numentires. The hyperlink then will take you to the page starting with the d(th) entry and each page is numentries long.

    Okay thats the explanation and code for navigation numbers, if you still have questions please post them in the Support Forums
    News Categories
  • Site News
  • Technology news
  • Programming news
  • Other Major News


  • Search Articles


    Make Money
    Free Blog promotion -- Get your blog syndicated on thousands of other blogs for free.

    Tutorial Categories
    Ad Managers(5)
    Calendars(6)
    Chat systems(5)
    CMS systems(7)
    Cookies/Sessions(4)
    Counters(8)
    E-commerce(7)
    File Manipulation(4)
    Forms(10)
    Forums(4)
    Guestbooks(5)
    HTML/CSS Tutorials(12)
    Image-related(5)
    Link indexing/ Classifieds(6)
    Mailing Lists/E-mail(5)
    Misc(17)
    MySQL Related(9)
    Navigation/Templating(6)
    PHP Basics(10)
    Polls(3)
    RSS and other feeds(5)
    Searching(4)
    Security(13)
    XML and other parsing(3)


    Resources
    Scripts/Graphics
  • Ecommerce Website Design
  • Hotscripts
  • Boxedart
  • Zero Web
  • Edorel Free Hosting
  • Javascript Reference
  • Powerful Scripts
  • Scripts Bank
  • Finestzone Designs
  • Layouts 4 free
  • Website Resources
  • 4 templates
  • Free URL redirection
  • Web Hosting
  • Website Hosting
  • Photoshop Tutorials
  • PHP and MYSQL tutorials
  • Free Templates
  • Tutorials DB
  • Pure Graphics
  • Total Tutorials
  • Myspace Pro Designs


  • Random Affiliates
        
        
        

    More affiliates