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:
Unfortunately, your browser does not support inline Frames! Click here to view this page in a new window
Download:
Usage note:
- Download numlinks.zip
- Extract it and upload all files to your webserver (run the numlinksexample.php to see how it works)
- You have to import the numlinkfuctions.php with require_once(’numlinkfunctions.php’); into your script.
- Also import the numlinkstyle.css in your HTML header with <link rel=”stylesheet” type=”text/css” href=”numlinkstyle.css”>
- 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.
Recent Comments