Results 1 to 6 of 6

Thread: [RESOLVED] Recordset numeric paging problem

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2006
    Posts
    384

    Resolved [RESOLVED] Recordset numeric paging problem

    I did a numeric paging system for my results page.

    And this is my code:

    Code:
    <%
    pages = INT(total / rppage)
    IF (total Mod rppage) <> "0" Then pages = pages + 1
    For p = 1 To pages
    IF cpage = p Then
    %>
    &nbsp;<%=p%>&nbsp;
    <%Else%>
    &nbsp;<a href="?q=<%=search%>&cpage=<%=p%>"><%=p%></a>&nbsp;
    <%
    End IF
    NEXT
    %>
    pages: is the number of pages we need.
    total: total records
    rppage: is set to 10 which is the maximum number of results to show on each page.
    cpage: is current page

    I'm supposed to show them as:

    1 2 3 4 5 etc..

    And IF I click on 2 for example the link should be removed from it

    1 2 3 4 5

    But my code is not working I don't know why, I wrote if cpage = p Then ... but it's keeping the link on it.

    Thanks very much,
    zeid

  2. #2
    Addicted Member
    Join Date
    Aug 2007
    Location
    India
    Posts
    141

    Re: Recordset numeric paging problem

    Try this

    Code:
    <%
    pages = INT(total / rppage)
    IF CINT((total Mod rppage)) <> 0 Then pages = pages + 1
    For p = 1 To pages
    IF cpage = p Then
    %>
    &nbsp;<%=p%>&nbsp;
    <%Else%>
    &nbsp;<a href="?q=<%=search%>&cpage=<%=p%>"><%=p%></a>&nbsp;
    <%
    End IF
    NEXT
    %>
    Do Good. Be Good. The World is yours.

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2006
    Posts
    384

    Re: Recordset numeric paging problem

    Thanks, but sorry it didn't work either .. it kept showing the same.

  4. #4
    Addicted Member
    Join Date
    Aug 2007
    Location
    India
    Posts
    141

    Re: Recordset numeric paging problem

    check your line
    Code:
    <a href="?q=<%=search%>&cpage=<%=p%>"><%=p%></a>&nbsp;
    for instance you change it to this and run your code.

    Code:
    <a href="?"><%=p%></a>&nbsp;

    if its working then the problem is in this line
    Do Good. Be Good. The World is yours.

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2006
    Posts
    384

    Re: Recordset numeric paging problem

    Sorry I didn't understand what you said well ...

    my code works fine I mean the paging are good but just the link thing is not working.

    can you please retell me what u mean.

    Thank you very much,
    zeid

  6. #6

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2006
    Posts
    384

    Re: Recordset numeric paging problem

    I Fixed it by making cpage integer

    IF INT(cpage) = p Then

    Thanks anyway!,
    zeid

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width