Solved

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

Posted on 2004-11-01
160 Views
Last Modified: 2013-12-24
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>
0
Question by:gregoryrsmith
    4 Comments
     
    LVL 8

    Accepted Solution

    by:
    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
     
    LVL 17

    Expert Comment

    by:Tacobell777
    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
     
    LVL 11

    Expert Comment

    by:hart
    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
     
    LVL 35

    Expert Comment

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

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone. Privacy Policy Terms of Use

    Featured Post

    IT Security CISA, CISSP & CISM Certification

    Master the advanced techniques required to protect network resources from external threats with the IT Cyber Security bundle. Built around industry best-practice guidelines, the IT Cyber Security bundle consists of three in-depth courses.

    In our day to day coding, how many times have we come across a necessity to check whether a URL is a broken link or not? For those of you that answered countless and are using ColdFusion like myself, then this article is for you.  It will show yo…
    Most ColdFusion developers get confused between the CFSet, Duplicate, and Structcopy methods of copying a Structure, especially which one to use when. This Article will explain the differences in the approaches with examples; therefore, after readin…
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    how to add IIS SMTP to handle application/Scanner relays into office 365.

    860 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

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now