Site Navigation Code
  Home arrow Site Navigation Code arrow Page Scroller ver 3
Codewalker Forums 
  Tutorials  
Database Articles  
Miscellaneous  
Navigation Usability  
PEAR Articles  
Programming Basics  
Server Administration  
XML Tutorials  
  Reviews  
Database Book Reviews  
Linux Book Reviews  
Miscellaneous Reviews  
PHP Book Reviews  
PHP Software Reviews  
Server Admin Reviews  
SQL Tool Reviews  
  Code Gallery  
Content Management Code  
Contest Code  
Counters Code  
Database Code  
Date Time Code  
Discussion Board Code  
Email Code  
File Manipulation Code  
GUI Code  
Link Farm Code  
Miscellaneous Code  
Search Code  
Site Navigation Code  
User Management Code  
Forums Sitemap 
Download TestComplete 
JMSL Numerical Library 
IBM® developerWorks
Weekly Newsletter 
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
SITE NAVIGATION CODE

Page Scroller ver 3
By: Codewalkers
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 1
    2002-01-18

    Table of Contents:

    Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    This is enhancement of Page Scroller ver 2, I add a page map link so you can jump to any page.

    By : wibi

    <?
    /********************************************************************
    * page scroller code snippet.
    *
    * Copyright (C) 2001 Wibisono Sastrodiwiryo.
    * This program is free software licensed under the
    * GNU General Public License (GPL).
    *
    * CyberGL => Application Service Provider
    * http://www.cybergl.co.id
    * office@cybergl.co.id
    *
    * $Id: scroller3.php3,v 0.3 2001/06/18 13:28:30 wibi Exp $
    *********************************************************************/

    #---------------------------------------database configuration

    $db_user = "root";
    $db_pass = "pass";
    $db_name = "phpMember";
    $db_host = "localhost";

    mysql_pconnect($db_host, $db_user, $db_pass) or die("Unable to connect to SQL server");
    mysql_select_db($db_name) or die("Unable to select database");

    #---------------------------------------page scroller configuration

    $script="scroller3.php3";
    $offset+=0;
    $item_perpage= 2; #----change this to define how many item per page
    $prev= $offset-$item_perpage;
    $next= $offset+$item_perpage;


    #---------------------------------------query configuration

    $tbl_search = "country";
    $field="name ";

    $query="SELECT $field FROM $tbl_search WHERE $field LIKE '%$keyword%' LIMIT $offset, $item_perpage";
    $querytotal="SELECT count(*) FROM $tbl_search WHERE $field LIKE '%$keyword%'";
    $total=mysql_fetch_row(mysql_query($querytotal));

    #----modify the where clause to fit your query need

    #---------------------------------------page map

    $pages = (int) ($total[0] / $item_perpage);
    if ($total[0] % $item_perpage) {$pages++;}
    for ($a=1;$a<=$pages;$a++) {
    $map[$a] =" <a href=\"$script?offset=$offset2&keyword=$keyword\">$a</a> ";
    $offset2+=$item_perpage;
    }
    $pagemap=implode("|", $map);

    #---------------------------------------prev next condition
    if ($prev < 0) {$prev="";}
    else {$prev="<a href=\"$script?offset=$prev&keyword=$keyword\">&lt;&lt; PREV</a>";}
    if ($total[0] > $next) {$next="<a href=\"$script?offset=$next&keyword=$keyword\">NEXT &gt;&gt;</a>";}
    else {$next="";}

    ?>

    <html>
    <head><title>CyberGL Page Scroller</title></head>
    <body>
    Query:
    <?echo $query;?>
    <hr>
    <b><?echo $offset+1?> to <?echo $offset+$item_perpage?> of <?echo $total[0]?></b>
    <p>
    <?
    #---------------------------------------query process
    $data=mysql_query($query);
    $no=1;
    while ($result=mysql_fetch_array($data)) {
    ?>
    NO: <?echo $no+$offset;?>. <?echo $result[name]?><p>
    <? $no++;
    }
    #---------------------------------------page scroller
    ?>
    <table width="100%" cellpadding=0 cellspacing=0 border=0>
    <tr>
    <td nowrap><?echo $prev?></td>
    <td width="100%" align=center><?echo $pagemap?></td>
    <td align=right nowrap><?echo $next?></td>
    </tr>
    </table>
    </body>
    </html>
    DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

    More Site Navigation Code Articles
    More By Codewalkers

     

    IBM® developerWorks developerWorks - FREE Tools!


    NEW! Accelerating Software Innovation on i on Power Systems

    Attend this launch webcast with Scott Hebner, Vice President of IBM Rational Marketing and Strategy, for an overview of Rational’s new software offerings and resources to help modernize and accelerate software innovation on i on Power Systems – while ensuring past application investments are protected and continue to grow. Learn how these solutions are helping customers extend their core i5/OS solutions toward modern architectures such as SOA and web technologies to deliver business improvements that stand the test of time.
    FREE! Go There Now!


    NEW! Applying lean thinking to the governance of software development

    Effective governance for lean development isn’t about command and control. Instead, the focus is on enabling the right behaviors and practices through collaborative and supportive techniques. Hear from Scott Ambler on how it is far more effective to motivate people to do the right thing than it is to force them to do so. Learn how to form a lightweight, collaboration-based framework that reflects the realities of modern IT organizations.
    FREE! Go There Now!


    NEW! Download a free trial of WebSphere Business Modeler Advanced V6.1.1

    Visit IBM developerWorks to download a free trial version of WebSphere Business Modeler Advanced V6.1.1, IBM’s premier business process modeling and analysis tool for business users that offers process modeling, simulation, and analysis capabilities. IBM WebSphere Business Modeler helps you visualize, understand, and document business processes for continuous improvement.
    FREE! Go There Now!


    NEW! Evaluate IBM Rational Software Analyzer V7.0

    Download a free trial version of IBM Rational Software Analyzer Developer Edition V7.0 to identify bug defects earlier in the software development cycle. Rational Software Analyzer is an extensible software development solution that reduces the expense of bug-fixes by enabling static analysis code reviews and bug identification very early in the development cycle.
    FREE! Go There Now!


    NEW! Evaluate Rational Host Access Transformation Services (HATS) Toolkit V7.1

    Visit IBM developerWorks to download a free trial of the Rational Host Access Transformation Services (HATS) Toolkit. The HATS toolkit provides a set of plug-ins for the IBM Rational Software Delivery Platform to help you easily extend your legacy applications. HATS makes your 3270 and 5250 applications available as HTML through the most popular Web browsers, while converting your host screens to a Web look and feel and it also enables you to develop new Web, portal, and rich-client applications.
    FREE! Go There Now!


    NEW! Rational Talks to You:Per Kroll on Rational Method Composer Plug-in customization

    Join this Rational Talks to You teleconference on December 11 at 1:00 pm ET to get tips on building your own plugins with Rational Method Composer. Get your questions answered!
    FREE! Go There Now!


    NEW! Trial download: IBM Lotus Forms V3.0

    Get a free trial download of IBM Lotus Forms V3.0 (formerly Workplace Forms), which provides a zero-footprint eForms solution to help you automate and move forms-based business processes off the desktop and onto the Web. With Lotus Forms, you can extend applications beyond the firewall by creating a single electronic form document ready for use in both thick and Web 2.0 thin client format.
    FREE! Go There Now!


    NEW! Using IBM Rational Developer for System z and IBM Rational ClearCase together to manage application development

    Whether you are creating new applications or modifying existing ones, managing integration of new components with traditional z/OS elements is a critical part of building and deploying modern applications. Listen to this webcast to see how IBM can help you optimize your development process using an IDE like Rational Developer for System z that integrates with management tools, such as ClearCase to manage your application development on mainframes.
    FREE! Go There Now!


    NEW! Webcast: Accelerating Software Innovation with System z

    Attend this launch webcast with Scott Hebner, Vice President of IBM Rational Marketing and Strategy, where he will overview Rational’s new offerings and programs to help customers accelerate software innovation on System z. He will discuss how these solutions help organizations extend their core business processes toward modern architectures such as SOA and web technologies to deliver business improvements that stand the test of time.
    FREE! Go There Now!


    NEW! Webcast: Calling All Testers! Find Application Vulnerabilities Early in the Development Process Where they are Easier to Fix and Less Risky to your Business

    In this webcast, IBM Rational will discuss the importance of Web application security and will share techniques and best practices to introduce application security testing into current QA processes including: understanding common security vulnerabilities and techniques to integrate security testing with defect tracking and remediation systems in an effort to safeguard sensitive online information.
    FREE! Go There Now!



    All FREE IBM® developerWorks Tools!

    SITE NAVIGATION CODE ARTICLES

    - Simple Menu System
    - Simply image viewer script
    - Simple File Lister
    - Dynamic Error Pages
    - BSoftEditor
    - Yahoo Status
    - Page numbers
    - PHP Search Navigator 1.0
    - Simple Page Navigation
    - An easy page browser ( prev 6 7 8 9 10 next )
    - AutoIndex PHP Script (Directory Indexer)
    - Bs_HtmlNavigation (Navigation and Sitemap cl...
    - Another Paging with Stage
    - Website Navigation via PHP
    - MySQL Paging Class





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
    Stay green...Green IT