Session Variable Woes
I am trying to create a registration page, not for self login, but for my customers to receive a newsletter.
My database connectivity works fine, and the records are getting stored. My CFMail piece works fine.
My problem is that I need to be able to pass the variable from the Insert record page (registration page) to the success.cfm (detail page) There are 2 reasons I need this. One is for the "Thanks for Registering Username" 2) so that I can pass the session variable of the email entered on the insert record page to the results page so that CFMail can send back a confirmation to the user that they have been successfully registered to receive a newsletter. CFMail works, and so does the insert record page.
I just don't seem to find good information on creating, passing, and retrieving the Session variables, which is where I think the problem lies at the moment.
Thanks in advance for your help!
Comments
Session Variable Woes - The Answer!
If you are wanting to immediately and automatically login the user after registration then sure create a sesison variable of the USR_ID and away you go. You can now query the database using the USRID whenever you need info for that user.
From what you have said you are only requiring to pass some of the registration details to the subsequent page. If this is the case then simply extract the USR_ID of the record you have just inserted [@@IDENTITY for SQL Server; last_insert_ID() for MySQL; or you can use the recordset method object using .asp (just search in google for the keywords I have mentioned to find a good tutorial on retrieving the last inser ID)]. Having extracted the USR_ID of the record youo have added pass that to the thankyou page via a QueryString. On the thankyou page requery the database to get the username, email etc.
Have fun.
You must me logged in to write a comment.