Saturday, 15 August 2015

coldfusion - Value for my session variable? -


Here's my code to create a session variable:

   

I have to put a value in = "" , but I have to change the value of having a user ID, depending on which user is logged in has been done. So I can not just keep any number etc. what I have to do?

Actually, you are going to do this when you log in your user in. These routines may look like the following:

  & lt; Cfquery data source = "cfgossip" name = "signin" & gt; Use via Select ID_Users = & lt; Cfqueryparam cfsqltype = "cf_sql_varchar" value = "#form.unpose" /> And PW = & lt; Cfqueryparam cfsqltype = "cf_sql_varchar" value = "#form.pw #" /> & Lt; / Cfquery & gt; & Lt; Cfif signin.recordCount & gt; & Lt; Cfset session.idUsers = signin.id_users/ & gt; & Lt; / Cfif>  

Until they are logged in, you can not know which value you need? However, once you determine that they are those they say they are and you are going to go to them, then you can set session variables.


No comments:

Post a Comment