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

Hi,

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#
</cfquery>
gregoryrsmithAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

sigmaconCommented:
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#">
</cfquery>

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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Tacobell777Commented:
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#'
</cfquery>

But it would help to see some error message to solve your problems...
0
hartCommented:
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

Regards
Hart
0
mrichmonCommented:
You could also change the form to get instead of post and it will automatically go in the URL.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Servers

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.