[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
%>
<%=p%>
<%Else%>
<a href="?q=<%=search%>&cpage=<%=p%>"><%=p%></a>
<%
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
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
%>
<%=p%>
<%Else%>
<a href="?q=<%=search%>&cpage=<%=p%>"><%=p%></a>
<%
End IF
NEXT
%>
Re: Recordset numeric paging problem
Thanks, but sorry it didn't work either .. it kept showing the same.
Re: Recordset numeric paging problem
check your line
Code:
<a href="?q=<%=search%>&cpage=<%=p%>"><%=p%></a>
for instance you change it to this and run your code.
Code:
<a href="?"><%=p%></a>
if its working then the problem is in this line
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
Re: Recordset numeric paging problem
I Fixed it by making cpage integer
IF INT(cpage) = p Then
Thanks anyway!,
zeid