Avatar of Kin Fat SZE
Kin Fat SZE
Flag 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
ColdFusion LanguageScripting Languages

Avatar of undefined
Last Comment
Coast Line

8/22/2022 - Mon
SOLUTION
Coast Line

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
RickEpnet

If you want the URL value to be different in the URL you need to change that on the previous page.
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?
gdemaria

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>
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
RickEpnet

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
Coast Line

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question