< Prev Next > - 1. 2. 3. page link PHP function - Easy to use!

Finished scripts, PHP 13 Comments »

If you list hundred or thousand records from a database on your website, it is unconfortable to show all of these on one page. So I wrote a < 1. 2. 3. > link function in PHP to browse through the pages like browsing through google results with a previous and next link. It is also simple to customize the design. Just change the styles in the numlinkstyle.css stylsheet file.

Example:

Download:

Numlinks V1.0

Usage note:

  1. Download numlinks.zip
  2. Extract it and upload all files to your webserver (run the numlinksexample.php to see how it works)
  3. You have to import the numlinkfuctions.php with require_once(’numlinkfunctions.php’); into your script.
  4. Also import the numlinkstyle.css in your HTML header with <link rel=”stylesheet” type=”text/css” href=”numlinkstyle.css”>
  5. Insert the function numlinks($pagenum, $maxpage, $pages_visible, $scriptname, $get); with the following parameters into your PHP code:
    $pagenum: Number of the current page
    $maxpage: Number of all pages
    $pages_visible: Maximum number of pages to be displayed (usually a odd number)
    $scriptname: Optional - File to which a number links
    $get: Optional - to deliver custom GET parameters (e.g. foo=bar&email=bla@hotmail.com)

Any Questions? Leave a comment!
* If you like this script, and in case you want to support us, we would appreciate it if you put a link to http://blog.polymorph.at on your website.

WP Theme & Icons by N.Design Studio
Entries RSS Comments RSS Log in