dynamic pages plus next/previous links

Ok, I have the following script that creates navigational pages number dynamically but I also need a Next >  and < Previous links so let's say you're on page 3 you could click on 4 to get to that page OR click Next > and that would get you there.  Same idea for the < Previous.  Let me know if you have any thoughts.  Here's what I have for the page numbers:


<!----------------------------------------------------------
START FIRST PAGE
------------------------------------------------------------>
<html>
<head>
     <title>page 1</title>
</head>

<body>

<cfquery datasource="dsn_name" name="GetImages">
Select *
FROM pickuparea
</cfquery>

<!--- What row to start at? Assume first by default --->
<cfparam name="url.startrow" default="1">
<!--- We know the total number of rows from the query --->
<cfset totalrows = GetImages.recordcount>
<!--- Allow for show all parameter in the URL --->
<cfparam name="url.showall" type="boolean" default="no">
<!--- Number of rows to display per Next/Back page --->
<cfset rowsperpage = 15>
<!--- Show all on page if show all passed in url --->
<cfif url.showall>
     <cfset rowsperpage = totalrows>
</cfif>
<!--- URL tampering --->
<cfif IsDefined("url.startrow")>
     <cfif NOT IsNumeric(url.startrow)>
          <cfset url.startrow = 1>
     </cfif>
</cfif>
<!--- Last row is 10 rows past the starting row, or total number of query rows, whichever is less --->
<cfset endrow = min(url.startrow + rowsperpage - 1, totalrows)>
<!--- Next button goes to 1 past current end row --->
<cfset startrownext = endrow + 1>
<!--- Back button goes back N rows from start row --->
<cfset startrowback = url.startrow - rowsperpage>


     
        <table width="100%" border="0" cellpadding="2" cellspacing="0" >
          <tr>
            <td><strong>item pic numbers:</strong></td>
          </tr>
          <cfloop query="GetImages" startrow="#url.startrow#" endrow="#endrow#">
            <cfoutput>
              <tr bgcolor="#IIf(CurrentRow Mod 2, DE('ffffff'), DE('F9F8F8'))#">
                <td>#GetImages.id#</td>
              </tr>
            </cfoutput>
          </cfloop>
        </table>
                   
        <cfif not url.showall and totalrows GT rowsperpage>
          <!--- Shortcut links for page of search results --->
          <br>
          Page
          <cfinclude template="dpages2.cfm">          
          <!--- Show all link --->
          <cfoutput><a href="#cgi.SCRIPT_NAME#?showall=yes">Show All</a></cfoutput>
        </cfif>

</body>
</html>

<!----------------------------------------------------------
END FIRST PAGE
------------------------------------------------------------>


<!----------------------------------------------------------
START SECOND PAGE
------------------------------------------------------------>

<!--- Simple page counter starting at the first page --->
<cfset thispage = 1>

<!--- Loop thru row numbers --->
<cfloop from="1" to="#totalrows#" step="#rowsperpage#" index="pagerow">
<!--- Detect whether this page is currently being viewed --->
<cfset iscurrentpage = (pagerow GTE url.startrow) and (pagerow LTE endrow)>

<!--- If this is current page, show without link --->
<cfif iscurrentpage>
     <cfoutput><b>#thispage#</b></cfoutput>
<!--- Otherwise, show with link so user can go to page --->
     <cfelse>
     <cfoutput>
          <a href="#cgi.SCRIPT_NAME#?startrow=#pagerow#">#thispage#</a>
     </cfoutput>
</cfif>

<!--- Increment this page --->
<cfset thispage = thispage + 1>
</cfloop>

<!----------------------------------------------------------
END SECOND PAGE
------------------------------------------------------------>
COwebmasterAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

SidFishesCommented:
Here's some search results code where the query is named metasearch...obviously you'll need to modify this to suit your needs but should give you the idea
   
<cfset display=5> <!--- you could use a variable to set how many rows to display --->
<cfoutput>
Your Search Returned #metasearch.recordcount# Records

<cfif #start# is not 1>
<a href="#request.url#index.cfm/fuseaction/home.metasearch/start/#PrevX#/display/#display#/searchstring/#varsearch#/menu/main.html"> &lt;&lt; PREVIOUS </a>
</cfif>

<cfif nextX LTE metasearch.RecordCount>
<a href="#request.url#index.cfm/fuseaction/home.metasearch/start/#nextX#/display/#display#/searchstring/#varsearch#/menu/main.html"> NEXT &gt;&gt;</a>
</cfif>
</cfoutput>


<CFOUTPUT query = "metaSearch" startrow="#start#" maxrows="#display#">
<cfset NextPrevVar = #URL#>

<cfset PerScore = int(score*100)><!--- this uses Verity's relevance scoring system --->
Score: #Perscore#% : #left(metaSearch.Summary,100)#...
This is a summary
<A href="#request.url#index.cfm/fuseaction=home.#docFuse#/varterm/#left(DocTitle,1)#/#DocCategory#/#DocID#/searchtext/#varsearch#.html">View</a>
This is the link to the full text    

</cfoutput>

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
srikanthmadishettiCommented:
<!-- this is teh header page for any paging page -->
<CFIF ISDEFINED("CURRENTFILE") AND ISDEFINED("TOTREC") > 
      
            <CFIF NOT ISDEFINED("SWIDTH")>
                  <CFSET SWIDTH ="98%">
            </CFIF>
            
            <CFPARAM NAME="n_pgno" DEFAULT=1>
            
            <cfif trim(n_pgno) eq ''>
                  <cfset n_pgno=1>
            </cfif>
       
            
                          
            <CFIF NOT ISDEFINED("startrow") AND NOT ISDEFINED("maxrows")>
                  <CFPARAM NAME="startrow" DEFAULT="1">      
                  <cfif isdefined('NotDefaultMaxrows')>
                        <cfif totrec lte 2>
                              <cfset maxrows=2>
                        <cfelseif totrec lte 5 and totrec gt 2>
                              <cfset maxrows=5>
                        <cfelseif totrec lte 10 and totrec gt 5>
                              <cfset maxrows=10>
                        <cfelseif totrec lte 15 and totrec gt 10>
                              <cfset maxrows=15>
                        <cfelseif totrec lte 20 and totrec gt 15>
                              <cfset maxrows=20>
                        <cfelseif totrec lte 30 and totrec gt 20>
                              <cfset maxrows=30>
                        <cfelseif totrec lte 50 and totrec gt 30>
                              <cfset maxrows=50>
                        </cfif>                  
                  <cfelse>
                <CFPARAM NAME="maxrows" DEFAULT="10">
                  </cfif>      
        <CFELSEIF  ISDEFINED("maxrows") AND (ISDEFINED("n_pgno") and n_pgno gt 1)>
            <cfset setStartRowVal = val(EVALUATE(maxrows*n_pgno-maxrows+1))>            
            <CFPARAM NAME="startrow" DEFAULT="#setStartRowVal#" type="numeric">    
        <CFELSEIF  ISDEFINED("maxrows") AND (ISDEFINED("n_pgno") and n_pgno lte 1)>
            <CFPARAM NAME="startrow" default="1">
            <CFELSE>
                  <CFSET STARTROW = STARTROW> <!--- This is initialised when paging takes place --->      
                  <CFSET MAXROWS = MAXROWS>                  
            </CFIF>
            <CFSET TOT_PGNO = CEILING(TOTREC / VAL(MAXROWS))>      
            <CFIF ISDEFINED('CHECK_PAGE')>      <!-- this executes only if the user specifies the details as per his needs. -->
                  <CFIF CHECK_PAGE EQ 'N' and trim(N_PGNO) neq ''>
                        <CFSET N_PGNO = N_PGNO>      
                        <cfif N_PGNO GT TOT_PGNO and TOT_PGNO GT 0><!--- if all records of the last page are deleted, should return to the previous page  --->
                              <cfset N_PGNO=TOT_PGNO>      
                        </cfif>
                        <CFOUTPUT>
                              <CFLOOP INDEX="ctr" FROM="1" TO="#n_pgno#">                                    
                                    <CFIF CTR GTE 2>
                                          <CFSET STARTROW = STARTROW + MAXROWS>
                                    </CFIF>
                              </CFLOOP>      
                        </CFOUTPUT>
                  </CFIF>
            </CFIF>                        
</CFIF>      

<--header ends>

<---- paging footer---->
<link href="style.css" rel="stylesheet" type="text/css">
<cfset sTableHeaderBgImg = "">
<!--- defined the variables used for paging --->
<CFIF ISDEFINED("CURRENTFILE") AND ISDEFINED("TOTREC")>      
    <cfparam name="get_n_pgno" default="">
      <CFIF NOT ISDEFINED("SWIDTH")>
            <CFSET SWIDTH ="98%">
      </CFIF>
      
      <CFIF TOTREC GT 0 AND TOTREC GT MAXROWS>      
            <CFOUTPUT>
                  <SCRIPT LANGUAGE="JavaScript">
                        function ValidatePagingFooter()      
                                    {              
                                          var names=document.calc_pgno.get_n_pgno.value;
                                          var FSnames=document.calc_pgno.get_n_pgno;
                                          
                                          var str=new String();
                                          str=names;
                                          var span=new RegExp("[ ]","g");
                                          var rep=str.replace(span,"a");            
                                                
                                          if(names == '' || isNaN(names) == true  || isNaN(rep) == true || names.indexOf('.') != -1 || names.indexOf('+') != -1 || names.indexOf('-') != -1)
                                                {
                                                      alert("You must enter the page no. properly");      
                                                      FSnames.select();
                                                      FSnames.focus();
                                                      return false;
                                                }                                                                                    
                                          else            
                                                                  
                                          var pgno_limit = eval(document.calc_pgno.pgno_limit.value);
                                          var pgno_request = eval(names);
                                                      
                                          if((pgno_request > pgno_limit) || (names <= 0))
                                                {
                                                      alert("Please enter page no. between [ 1 - " + pgno_limit +" ]");
                                                      FSnames.select();
                                                      FSnames.focus();
                                                      return false;                  
                                                }      
                                          else
                                                {
                                if(document.calc_pgno.get_n_pgno.value != '') //incase the page no. is defined, transfer the value as n_pgno
                                    {                                                                                                  
                                    document.calc_pgno.n_pgno.value=document.calc_pgno.get_n_pgno.value;
                                    }
                                                    document.calc_pgno.startrow.value="1";
                                    document.calc_pgno.check_page.value="N";                        
                                    document.calc_pgno.maxrows.value="#maxrows#";                                                      
                                                    document.calc_pgno.action = "#CurrentFile#";
                                                    document.calc_pgno.submit ();
                                                }
                                                
                                                
                                    }                                                
                              
                        function HitPrev()
                              {  
                                                                                     
                        document.calc_pgno.n_pgno.value="#Evaluate(n_pgno-1)#";                                              
                                    document.calc_pgno.startrow.value="#Evaluate(StartRow - MaxRows)#";
                        document.calc_pgno.check_page.value="Y";                        
                        document.calc_pgno.maxrows.value="#maxrows#";                        
                        document.calc_pgno.action = "#CurrentFile#";
                                    document.calc_pgno.submit ();
                              }      
                   
               function HitFirst()
                              {  
                                                                                   
                        document.calc_pgno.n_pgno.value="1";                        
                                    document.calc_pgno.startrow.value="1";
                        document.calc_pgno.check_page.value="Y";                        
                        document.calc_pgno.maxrows.value="#maxrows#";
                        document.calc_pgno.action = "#CurrentFile#";
                                    document.calc_pgno.submit ();
                              }      
                                                       
                        function HitNext()
                              {  
                                    document.calc_pgno.n_pgno.value="#Evaluate(n_pgno+1)#";
                        document.calc_pgno.startrow.value="#Evaluate(StartRow + MaxRows)#";
                        document.calc_pgno.check_page.value="Y";                        
                        document.calc_pgno.maxrows.value="#maxrows#";
                        document.calc_pgno.action = "#CurrentFile#";
                        document.calc_pgno.submit ();
                              }
                   
                function HitLast()
                              {  
                        document.calc_pgno.n_pgno.value="#TOT_PGNO#";
                        document.calc_pgno.startrow.value="#Evaluate((TOT_PGNO-1)*maxrows+1)#";
                        document.calc_pgno.check_page.value="Y";                        
                        document.calc_pgno.maxrows.value="#maxrows#";
                                    document.calc_pgno.action = "#CurrentFile#";
                                    document.calc_pgno.submit ();
                              }        
                              
                              // function for the header file.
                        function SubmitPagingHeader()
                              {
                                    document.show_records.action = "#CurrentFile#";
                                    document.show_records.submit ();
                              }      
                              
                  </SCRIPT>
            </CFOUTPUT>
            
      </CFIF>
      
      <CFOUTPUT>
    <cfset s_font_color = "white">
    <TABLE WIDTH="#SWIDTH#" CELLSPACING="0" CELLPADDING="0" BORDER="0" ALIGN="center">
                        <TR VALIGN="middle" class="tableheader">
                        </CFOUTPUT>
                  <CFIF TOTREC GT 0 AND TOTREC GT MAXROWS>                              
                              <!--- 25% for BELOW form of diaplaying the records / page --->
                              <cfoutput>
                              <TD HEIGHT="25" WIDTH="1%" BACKGROUND="#sTableHeaderBgImg#">
                              <FORM NAME="show_records" METHOD="post" action="">
                              <CFIF (ISDEFINED('LST_HIDDEN_NAMES') AND LISTLEN(LST_HIDDEN_NAMES,",") GT 0) AND (ISDEFINED('LST_HIDDEN_VALUES') AND LISTLEN(LST_HIDDEN_VALUES,",") GT 0) >                                    
                                    <CFIF LISTLEN(LST_HIDDEN_NAMES,",")       EQ LISTLEN(LST_HIDDEN_VALUES,",")>                                          
                                          <CFLOOP INDEX="HIDDEN_CTR"  FROM="1" TO="#LISTLEN(LST_HIDDEN_NAMES,",")#">
                                                <INPUT TYPE="HIDDEN" NAME="#LISTGETAT(LST_HIDDEN_NAMES,HIDDEN_CTR,",")#" VALUE="#LISTGETAT(LST_HIDDEN_VALUES,HIDDEN_CTR,",")#">      
                                          </CFLOOP>
                                    </CFIF>
                              </CFIF>&nbsp;
                              </TD>                        
                              <TD HEIGHT="25" WIDTH="1%" BACKGROUND="#sTableHeaderBgImg#"><INPUT TYPE="Hidden" NAME="showme_recs" VALUE="Y">&nbsp;</TD>
                              <TD HEIGHT="25" WIDTH="15%" BACKGROUND="#sTableHeaderBgImg#" NOWRAP align="right"><FONT FACE="Verdana" SIZE="1" COLOR="#s_font_color#"><B>Records/Page :</B></FONT></TD>                                    
                              <TD HEIGHT="25" WIDTH="7%" BACKGROUND="#sTableHeaderBgImg#" ALIGN="center">
                                    <SELECT NAME="maxrows" STYLE="font-family: Verdana; font-size: 10 pt" class="inputform">
                                          <OPTION VALUE="2" <CFIF MAXROWS EQ 2>selected</CFIF>>2</OPTION>
                                          <OPTION VALUE="5" <CFIF MAXROWS EQ 5>selected</CFIF>>5</OPTION>
                                          <OPTION VALUE="10" <CFIF MAXROWS EQ 10>selected</CFIF>>10</OPTION>
                            <OPTION VALUE="15" <CFIF MAXROWS EQ 15>selected</CFIF>>15</OPTION>
                                          <OPTION VALUE="20" <CFIF MAXROWS EQ 20>selected</CFIF>>20</OPTION>
                                          <cfif not isDefined("sFileFromStyle")>
                                          <OPTION VALUE="30" <CFIF MAXROWS EQ 30>selected</CFIF>>30</OPTION>
                            <OPTION VALUE="50" <CFIF MAXROWS EQ 50>selected</CFIF>>50</OPTION>                  
                            </cfif>                        
                                    </SELECT>
                              </TD>                        
                              <TD HEIGHT="25" WIDTH="5%" BACKGROUND="#sTableHeaderBgImg#" ALIGN="center"><A HREF="Javascript:SubmitPagingHeader()"><IMG SRC="images/b_go.jpg" ALT="Go" BORDER="0"></A></TD>
                              <TD HEIGHT="25" WIDTH="1%" BACKGROUND="#sTableHeaderBgImg#"><INPUT TYPE="hidden" NAME="startrow" VALUE="1" SIZE="2"></CFOUTPUT></FORM>&nbsp;</TD>
      
                              
                              <!--- 51 % FOR BELOW FORM ! --->
                              
                              <CFOUTPUT><TD HEIGHT="25" WIDTH="1%" BACKGROUND="#sTableHeaderBgImg#"><FORM NAME="calc_pgno" action="" METHOD="post" ONSUBMIT="return ValidatePagingFooter()">&nbsp;</TD>
                              <CFIF (ISDEFINED('LST_HIDDEN_NAMES') AND LISTLEN(LST_HIDDEN_NAMES,",") GT 0) AND (ISDEFINED('LST_HIDDEN_VALUES') AND LISTLEN(LST_HIDDEN_VALUES,",") GT 0) >                                    
                                    <CFIF LISTLEN(LST_HIDDEN_NAMES,",")       EQ LISTLEN(LST_HIDDEN_VALUES,",")>                                          
                                          <CFLOOP INDEX="HIDDEN_CTR"  FROM="1" TO="#LISTLEN(LST_HIDDEN_NAMES,",")#">
                                                <INPUT TYPE="HIDDEN" NAME="#LISTGETAT(LST_HIDDEN_NAMES,HIDDEN_CTR,",")#" VALUE="#LISTGETAT(LST_HIDDEN_VALUES,HIDDEN_CTR,",")#">      
                                          </CFLOOP>
                                    </CFIF>
                              </CFIF>

                              <TD HEIGHT="25" WIDTH="1%" BACKGROUND="#sTableHeaderBgImg#">&nbsp;</TD>
                              <TD HEIGHT="25" WIDTH="1%" BACKGROUND="#sTableHeaderBgImg#" ALIGN="center">                                    
                                    <CFSET SMAXLENGTH = LEN(TOT_PGNO)>
                                    <INPUT TYPE="hidden" NAME="pgno_limit" VALUE="#tot_pgno#">
                                    <INPUT TYPE="hidden" NAME="totrec" VALUE="#totrec#" SIZE="3">
                        &nbsp;
                    </TD>                              
                              <TD HEIGHT="25" WIDTH="1%" BACKGROUND="#sTableHeaderBgImg#">&nbsp;</TD>      
                              <TD HEIGHT="25" WIDTH="15%" BACKGROUND="#sTableHeaderBgImg#" ALIGN="right" NOWRAP>      
                                    <FONT FACE="Verdana" SIZE="1" COLOR="#s_font_color#"><B>Page [&nbsp;#n_pgno#&nbsp;of&nbsp;#tot_pgno#&nbsp;]</FONT></B></TD>      
                              <TD HEIGHT="25" WIDTH="5%" BACKGROUND="#sTableHeaderBgImg#" ALIGN="center" valign="middle">            
                                    <INPUT type="text" NAME="get_n_pgno" SIZE="2" VALUE="" MAXLENGTH="#SMAXLENGTH#" class="inputform">&nbsp;</TD>                                    
                              <TD HEIGHT="25" WIDTH="5%" BACKGROUND="#sTableHeaderBgImg#" ALIGN="center">            
                                    <INPUT TYPE="Image" SRC="images/b_go.jpg" BORDER="0" ALT="Go" ></TD>
                              </TD>
                    <input type="hidden" name="n_pgno" value="#n_pgno#">
                              <TD HEIGHT="25" WIDTH="4%" BACKGROUND="#sTableHeaderBgImg#">&nbsp;</TD>                              
                              
                              <!--- below is the display of prev & next buttons which takes 25% of the total width avilable --->
                              <CFIF STARTROW GTE MAXROWS AND STARTROW GT 1>
                                  <TD HEIGHT="25" WIDTH="13%" BACKGROUND="#sTableHeaderBgImg#" align="right">
                                <A HREF="JavaScript:HitFirst()"><IMG align="middle" SRC="images/icon_first.jpg" BORDER="0" ALT="First"></A>                                          
                        </TD>
                        <TD HEIGHT="25" WIDTH="7%" BACKGROUND="#sTableHeaderBgImg#" align="center">
                            <A HREF="JavaScript:HitPrev()"><IMG align="middle" SRC="images/icon_previous.jpg" BORDER="0" ALT="Previous"></A>
                            </TD>
                    <CFELSE>                    
                        <TD HEIGHT="25" ALIGN="right" WIDTH="19%" BACKGROUND="#sTableHeaderBgImg#" VALIGN="bottom">&nbsp;
                            </TD>
                    </CFIF>                        
                                    
                    <CFIF (STARTROW + MAXROWS) LTE TOTREC>                                
                        <TD HEIGHT="25" WIDTH="7%" BACKGROUND="#sTableHeaderBgImg#" align="center">      
                            <A HREF="JavaScript:HitNext()"><IMG align="middle" SRC="images/icon_next.jpg" BORDER="0" ALT="Next"></A>
                        </TD>
                        <TD HEIGHT="25" WIDTH="10%" BACKGROUND="#sTableHeaderBgImg#" align="left">      
                            <A HREF="JavaScript:HitLast()"><IMG align="middle" SRC="images/icon_last.jpg" BORDER="0" ALT="Last"></A>      
                        </TD>                                    
                    <CFELSE>
                        <TD HEIGHT="25" ALIGN="right" WIDTH="17%" BACKGROUND="#sTableHeaderBgImg#" VALIGN="bottom">&nbsp;      
                           
                        </TD>
                    </CFIF>
                     <input type="hidden" name="startrow" value="">
                     <input type="hidden" name="maxrows" value="">
                     <input type="hidden" name="check_page" value="">                    
                     
                              <TD HEIGHT="25" WIDTH="1%" BACKGROUND="#sTableHeaderBgImg#"></FORM>&nbsp;</TD></CFOUTPUT>            
                              
      <CFELSEIF TOTREC GT 0>            <!--- no matter what this section of from is always diaplayed to the user . --->
                              
                    <CFOUTPUT>
                              <SCRIPT LANGUAGE="JavaScript">
                    <!--
                    // function for the header file.
                              function SubmitPagingHeader()
                                    {
                                          document.show_records.action = "#CurrentFile#";
                                          document.show_records.submit ();
                                    }      
                    //-->
                    </SCRIPT>
                              <!--- 25% for BELOW form of diaplaying the records / page --->
                              
                              <TD HEIGHT="25" WIDTH="1%" BACKGROUND="#sTableHeaderBgImg#"><FORM NAME="show_records" METHOD="post" action="">
                              <CFIF (ISDEFINED('LST_HIDDEN_NAMES') AND LISTLEN(LST_HIDDEN_NAMES,",") GT 0) AND (ISDEFINED('LST_HIDDEN_VALUES') AND LISTLEN(LST_HIDDEN_VALUES,",") GT 0) >                                    
                                    <CFIF LISTLEN(LST_HIDDEN_NAMES,",")       EQ LISTLEN(LST_HIDDEN_VALUES,",")>                                          
                                          <CFLOOP INDEX="HIDDEN_CTR"  FROM="1" TO="#LISTLEN(LST_HIDDEN_NAMES,",")#">
                                                <INPUT TYPE="HIDDEN" NAME="#LISTGETAT(LST_HIDDEN_NAMES,HIDDEN_CTR,",")#" VALUE="#LISTGETAT(LST_HIDDEN_VALUES,HIDDEN_CTR,",")#">      
                                          </CFLOOP>
                                    </CFIF>
                              </CFIF>&nbsp;</TD>                        
                              <TD HEIGHT="25" WIDTH="1%" BACKGROUND="#sTableHeaderBgImg#"><INPUT TYPE="Hidden" NAME="showme_recs" VALUE="Y">&nbsp;</TD>
                              <TD HEIGHT="25" WIDTH="15%" BACKGROUND="#sTableHeaderBgImg#" NOWRAP align="right"><FONT FACE="Verdana" SIZE="1" COLOR="#s_font_color#"><B>Records/Page :</B></FONT></TD>                                    
                              <TD HEIGHT="25" WIDTH="7%" BACKGROUND="#sTableHeaderBgImg#" ALIGN="center">
                                    <SELECT NAME="maxrows" STYLE="font-family: Verdana; font-size: 10 pt" class="inputform">
                                          <OPTION VALUE="2" <CFIF MAXROWS EQ 2>selected</CFIF>>2</OPTION>
                                          <OPTION VALUE="5" <CFIF MAXROWS EQ 5>selected</CFIF>>5</OPTION>
                                          <OPTION VALUE="10" <CFIF MAXROWS EQ 10>selected</CFIF>>10</OPTION>
                            <OPTION VALUE="15" <CFIF MAXROWS EQ 15>selected</CFIF>>15</OPTION>
                                          <OPTION VALUE="20" <CFIF MAXROWS EQ 20>selected</CFIF>>20</OPTION>
                                          <cfif not isDefined("sFileFromStyle")>
                                          <OPTION VALUE="30" <CFIF MAXROWS EQ 30>selected</CFIF>>30</OPTION>
                            <OPTION VALUE="50" <CFIF MAXROWS EQ 50>selected</CFIF>>50</OPTION>                  
                            </cfif>                        
                                    </SELECT>&nbsp;
                              </TD>                        
                              <TD HEIGHT="25" WIDTH="5%" BACKGROUND="#sTableHeaderBgImg#" ALIGN="center"><A HREF="Javascript:SubmitPagingHeader()"><IMG SRC="images/b_go.jpg" ALT="Go" BORDER="0"></A></TD>
                              <TD HEIGHT="25" WIDTH="1%" BACKGROUND="#sTableHeaderBgImg#"><INPUT TYPE="hidden" NAME="startrow" VALUE="1" SIZE="2"></FORM>&nbsp;</TD>
                              <TD HEIGHT="25" WIDTH="75%" BACKGROUND="#sTableHeaderBgImg#">&nbsp;</TD></CFOUTPUT>                        
                        
      </CFIF>
                        
                        </TR>
                        
                  </TABLE>            
                        
</CFIF>

   


<-- footer ends--->


<-- main page--->

<cfoutput>
<cfset currentFile="index.cfm">
<cfset TOTREC = qreport.recordCount>
<cfinclude template="Paging_Header.cfm">
</cfoutput>

use the query output  like this

 <cfoutput query="qreport" startrow="#StartRow#" maxrows="#maxrows#">
<cfinclude template="Paging_Footer.cfm">      




hey include the header and footer at the top and bottom of cfoutput query statement and set the two variables currentfile and TOTREC thats it
you can see navingation working .....
for you


COwebmasterAuthor Commented:
?
COwebmasterAuthor Commented:
Ok, I'll try this out..
COwebmasterAuthor Commented:
Thanks everyone!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Servers

From novice to tech pro — start learning today.