Skip to main content
Inspiring
Nov 11, 2009 10:54 PM UTC
Question

Question about url and form paramaters

I was just doing some testing on our coldfusion 8 server and it seems like the URL and FORM structures are universaly availible

everywhere, inside a CF function they are passed by reference.

Is there a way to disable this functionality? I have a cffunction that i don't want to have access to URL and FORM

from the main template, for reasons i don't really want to go into.

    This topic is closed to new replies. Start a new post to keep the conversation going.

    2 replies

    zeejayyAuthor
    Inspiring
    Nov 12, 2009 12:32 AM UTC

    I've done that where i can. This is more or less a quick hack to fix something while i redesign it to support

    a new feature correctly. Due to the situation theres some code that is sensitive to URL params being availible inside

    the function.

    I never knew until now that URL and FORM where pretty much global. I was trying to find out

    if i could create a function that ran in a completely private space with no access to the URL and FORM.

    Translate
    Inspiring
    Nov 12, 2009 12:10 AM UTC

    Step 1 - declare all your local variables with the keyword var after your cfargument tags.

    Step 2 - inside your function, refer only to the arguments and variables scopes.

    Translate