We help IT Professionals succeed at work.

coldfusion replace parameter value

341 Views
Last Modified: 2014-05-23
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
Comment
Watch Question

CERTIFIED EXPERT
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
If you want the URL value to be different in the URL you need to change that on the previous page.
CERTIFIED EXPERT

Author

Commented:
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?
CERTIFIED EXPERT

Commented:
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>
CERTIFIED EXPERT
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.