I'm sure there are several ways to do this <cfset FORM.some_url = " http://somesite.com/some_display.cfm?some_id=4184&chapter_id=12120&passage_id=40099 "/> <cfset params = listgetat(FORM.some_url,2,"?") /> <cfset p = listtoarray(params,"&" ) /> <cfset chapter_id = 0 /> <cfloop array="#p#" index="i" > <cfif find("chapter_id=", i)> <cfset chapter_id = listgetat(i, 2, "=") /> </cfif> </cfloop> <cfdump var="#chapter_id#" />
On Thu, Nov 15, 2012 at 8:28 AM, morchella <morchella.delici...@gmail.com>wrote: > > hey guys! > i could use a liitle help. i am trying to get a specific value. in this > example "chapter_id" > ListgetAt could work, but the returned form url cold have the value in a > different oposition at any time. > i thought i could use a delimiter specifiying ,"chapter_id=" but that dosnt > seem to work. > > <cfset FORM.some_url = " > > http://somesite.com/some_display.cfm?some_id=4184&chapter_id=12120&passage_id=40099 > " > /> > <cfset getChapterId = trim(ListLast(FORM.some_url,"chapter_id="))> > <cfset Param2 = ListGetAt(FORM.some_url,2,"&")> > > Param2: chapter_id=12120 << << Right, but only some times. > getChapterId: 40099 << << Wrong > > thanks a bunch. > i googled every thing from listtoarray to <cfdump > var="#getPageContext().getRequest().getParameterValues('FORM.some_url')#"> > Which dosnt seem to gel with cf7!! > thanks a bunch for clear out the cob webs this am.. > -m > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:353171 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm