Skip to main content
Participant
February 20, 2025
Answered

hyperlink with variable not working in CF2023

  • February 20, 2025
  • 1 reply
  • 1144 views

in a couple of places on my website i use hyperlinks with variables to go from one page to another

<a href request2.cfm?thearea=area2>Area 2</a>

this has worked perfectly for years right until the upgrade to CF2023 - now i get an error

Variable THEAREA is undefined

is there a solution besides changing to a button instead of a hyperlink - a button won't work when moving from one site to another

    Correct answer sdsinc_pmascari

    There was a security update to CF not too long ago that now requires you to include the scope of any variable in these scopes:  URL, FORM, CGI, COOKIE. 

    So, the place in your code that may look like: #thearea# now needs to be: #url.thearea#

    1 reply

    sdsinc_pmascariCorrect answer
    Legend
    February 20, 2025

    There was a security update to CF not too long ago that now requires you to include the scope of any variable in these scopes:  URL, FORM, CGI, COOKIE. 

    So, the place in your code that may look like: #thearea# now needs to be: #url.thearea#

    Participant
    February 20, 2025

    i just found that none of the forms are passing variable information either on this site -

    so if passing form info - form on registration page is regform2

    <cfform action="registration2.cfm" method="post" name="regform2">

    on registration2.cfm i changed #email# to #regform2.email#

    <cfinput name="email" type="text" validate="email" value="#regform2.email#">

    still getting error of variable not found - am i not reading your fix correctly ??

    this is currently the only site i am having problems with but this is the only site that has been upgraded to CF2023 - everything else is on 2021

    Charlie Arehart
    Community Expert
    Community Expert
    February 20, 2025

    Not regform2, just form. Cf doesn't care what the name of the form is. You're simply wanting to tell it to get the variable from whatever form submitted data to the page now processing it. 

    /Charlie (troubleshooter, carehart. org)