insert session 'hidden variable' into access table - problem

Posted on 2007-10-16
Last Modified: 2013-12-24
I have a form which has a hidden variable insertion  into an access database table. The hidden variable is a session variable, created via the login process. The form and action pages work, but I do not get the session value inserted into the web_name field. I get #Session.web_name# instead.

Would really appreciate some help

Heres what I have got

<input name="web_name" type="hidden" id="web_name" value="#Session.web_name#"> where web_name is the name of the session variable and also the name of the field in the database table.


the field name is correctly inserted into the INSERT INTO wearer_measur.... section

this is the related cfif statement for the INSERT INTO  above
<cfif IsDefined("FORM.web_name") AND #FORM.web_name# NEQ "">

many thanks in advance
Question by:jameskane
    LVL 19

    Expert Comment

    <cfparam name="session.web_name" default=""> in your action and also check to make sure that you use '#session.web_name#'
    LVL 51

    Accepted Solution

    You need to use <cfoutput> tags around the form field so CF evaluates the value of the variable.

    <input name="web_name" type="hidden" id="web_name" value="#Session.web_name#">

    Author Comment

    Well, thats all sorted out now. There were in fact two problems. Firstly, as you noted agx. And secondly there was the problem that the session variable was stored as Session.MM_Username and not web_name as I had assumed in my confused state !

    erikTsomik:could you say a little more about your point - I dont fully understand.

    THANKS to you both !
    LVL 19

    Expert Comment

    Well before it goes to the action page make sure the session is exist so just check it  IsDefined ("")

    Author Comment

    ok, understand, thanks erik


    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    Join & Write a Comment

    Suggested Solutions

    New Relic: Our company recently started researching several products to figure out what were the best ways for us to increase our web page speed and to quickly identify performance problems that we may be having. One of the products we evaluated wa…
    If I have to fix slow responding website my first thoughts are server side optimizations: the database may not be optimized or caching is not enabled, or things like that. We often overlook another major part of our web application: the client. We o…
    Use Wufoo, an online form creation tool, to make powerful forms. Learn how to choose which pages of your form are visible to your users based on their inputs. The page rules feature provides you with an opportunity to create if:then statements for y…
    Learn how to set-up PayPal payment integration in your Wufoo form. Allow your users to remit payment through PayPal upon completion of your online form. This is helpful for collecting membership payments, customer payments, donations, and more.

    755 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

    23 Experts available now in Live!

    Get 1:1 Help Now