|
-
Sep 10th, 2007, 06:07 AM
#1
Thread Starter
Hyperactive Member
[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
-
Sep 10th, 2007, 06:21 AM
#2
Addicted Member
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
%>
Do Good. Be Good. The World is yours.
-
Sep 10th, 2007, 06:27 AM
#3
Thread Starter
Hyperactive Member
Re: Recordset numeric paging problem
Thanks, but sorry it didn't work either .. it kept showing the same.
-
Sep 10th, 2007, 06:32 AM
#4
Addicted Member
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
Do Good. Be Good. The World is yours.
-
Sep 10th, 2007, 06:49 AM
#5
Thread Starter
Hyperactive Member
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
-
Sep 10th, 2007, 05:01 PM
#6
Thread Starter
Hyperactive Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|