Go Premium for a chance to win a PS4. Enter to Win


help <a href="scenes25.cfm?folderNum=#FORM.number#"> work

Posted on 2004-11-01
Medium Priority
Last Modified: 2013-12-24

I'm trying to pass a form variable via the URL and retrieve with this query

<cfquery name="getFolderNumber" datasource="xxx">
SELECT folderNum
FROM imageNames
WHERE folderNum = #URL.folderNum#
Question by:gregoryrsmith

Accepted Solution

sigmacon earned 1000 total points
ID: 12469158
Hi gregoryrsmith,

What is the error message or what is not working? Two things:

1) Make sure you have a <cfoutput></cfoutput> around the link, e.g. <cfoutput><a href="scenes25.cfm?folderNum=#FORM.number#"></cfoutput>
2) For security purposes, use <cfqueryparam> in you query:

<cfquery name="getFolderNumber" datasource="xxx">
SELECT folderNum
FROM imageNames
WHERE folderNum = <cfqueryparam cfsqltype="cf_sql_integer" value="#URL.folderNum#">

3) Make sure URL.folderNum exists before you try to use it: <cfif isDefined("URL.folderNum")> ...
LVL 17

Expert Comment

ID: 12469288
And make sure its an integer, if its a string you will need quotes around the value, i.e.

<cfquery name="getFolderNumber" datasource="xxx">
SELECT folderNum
FROM imageNames
WHERE folderNum = '#URL.folderNum#'

But it would help to see some error message to solve your problems...
LVL 11

Expert Comment

ID: 12470617
just a question why are u sending a form variable in the url, if u submit the form u will always get it in the processing page
kindly be more elaborate on your problem

LVL 35

Expert Comment

ID: 12476604
You could also change the form to get instead of post and it will automatically go in the URL.

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

One of the typical problems I have experienced is when you have to move a web server from one hosting site to another. You normally prepare all on the new host, transfer the site, change DNS and cross your fingers hoping all will be ok on new server…
What You Need to Know when Searching for a Webhost Provider
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…

916 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question