form variables from Login page: MX
I am attempting to pass hidden variables from a log in page to a success page. I understand that to do so i must create session variables for each hidden field value from value and pass them across as sv's. However this does not seem to be working as it should.
I am using the following code on the login page to capture the hidden field form variable: <% Session("Session1") = Request("fieldname") %>. On the success page i have the following code: <% Session("Session1") = Request.Form("fieldname") %>. I then use the bindings palette to create a session variable called 'Session1' and then insert that directly into the success page.
However I get no values coming across. Any help will be greatly appreciated.
thanks
Comments
Sessions from Login
You can add Session variables in the Login page, just some hand coding and altering of the Dreamweaver login script.
Locate this part of the script
' *** Validate request to log in to this site.
MM_LoginAction = Request.ServerVariables("URL")
If Request.QueryString<>"" Then MM_LoginAction = MM_LoginAction + "?" + Request.QueryString
MM_valUsername=CStr(Request.Form("UserName"))<-- create your varible in the same way
i.e mm_yourvarible="CStr"(Request.Form("yourfield"))
then
If Not MM_rsUser.EOF Or Not MM_rsUser.BOF Then
' username and password match - this is a valid user
Session("MM_Username") = MM_valUsername <-- add your session name from your varible as above
i.e Session("yourname") = MM_yourvarible
Hope this helps.
You must me logged in to write a comment.