Link to home
Start Free TrialLog in
Avatar of Kin Fat SZE
Kin Fat SZEFlag for Hong Kong

asked on

coldfusion replace parameter value

Dear all,
I want to know a way to replace url parameter value?

http://www.mywebxx.com/a.cfm?pageno=2
to be
http://www.mywebxx.com/a.cfm?pageno=1
or
http://www.mywebxx.com/a.cfm?pageno=3

Thanks
Francis SZE
SOLUTION
Avatar of Coast Line
Coast Line
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
If you want the URL value to be different in the URL you need to change that on the previous page.
Avatar of Kin Fat SZE

ASKER

I just want to find out how is the most easy way make previous , next page in coldfusion.
in case record greater than 20 it would have next page icon and pointing to http://www.mywebxx.com/a.cfm?pageno=3
whats the easy way to do it?
Your URL is in the variable   #cgi.script_name#    unless you have other query string variables to include (you are not showing any) then simply add the page number...

 <a href="#cgi.script_name#?pageno=1">First Page</a>
 <a href="#cgi.script_name#?pageno=2">Second Page</a>
If you posted your code it would help.
You can do something like this.

<cfif myquery.recordcount gt 10>
<a href="#cgi.script_name#?pageno=2">Second Page</a>
<cfelseif myquery.recordcount gt 20>
<a href="#cgi.script_name#?pageno=3">Second Page</a>
</cfif>
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial