LisaM
|
| Posted: 06/07/2004, 1:31 PM |
|
I have a login Table with the following:
Table Name: USERS
-> username
-> password
-> email
-> group
I need, at the point of login, to setsession of the email so i can use it later for many things, Forms, Labels, Grid Results, ect....
ASP. CCS
any help would be good,
Peace
Lisa
|
|
|
 |
ghtracey
Posts: 23
|
| Posted: 06/07/2004, 4:31 PM |
|
For ASP, search the help for Custom Session Variables. Read the topic "Create Custom Session Variables" it outlines how to do this very thing with a code example.
_________________
Graham Tracey
Council of Yukon First Nations |
 |
 |
miller
Posts: 5
|
| Posted: 06/08/2004, 8:01 AM |
|
Already tried, No Luck . got any sample code......
_________________
Joe Miller
Simpleton |
 |
 |
zolw
Posts: 51
|
| Posted: 06/08/2004, 9:12 AM |
|
Lisa:
You can get any info related to an autenticated user.
The following are all default session variables created by CodeCharge Studio:
UserID - the primary key field value of the logged in user
UserLogin - login name of the user currently logged into the system
GroupID - security level/group of the user currently logged into the system
If you need to get the email you can look for it using CCDLookup.
Variable = CCDLookUp("email","USERS","user_id="& Session("UserID"), DBxxxx)
Remember to change the xxxxxx after DB using the name of your db connection.
If you have any questions please contact me,
Carlos
_________________
Zolw
http://www.xlso.com |
 |
 |
Lisa
|
| Posted: 06/08/2004, 11:41 AM |
|
I want to put it into a datasource, how do i do that????????
|
|
|
 |
ghtracey
Posts: 23
|
| Posted: 06/08/2004, 12:12 PM |
|
Change the table and field names to match...
Function Login_DoLogin_OnClick()
Dim Connection1
If Login_DoLogin_OnClick = True Then
Set Connection1 = New clsDBConnection1
Connection1.Open
Session("User_Email") = CCDLookUp("Email","Users","User_ID="& Connection1.ToSQL(CCGetUserID(),ccsInteger), Connection1)
Connection1.Close
Set Connection1 = Nothing
End if
End Function
(mainly from the helpfile, I don't do ASP often)
From here, you can now access the current users email address anytime with
variable = Session("User_Email")
_________________
Graham Tracey
Council of Yukon First Nations |
 |
 |
lisa
|
| Posted: 06/08/2004, 12:31 PM |
|
It just cancels out, it goes nowhere now, i get a "HTTP 500 - Internal server error " but when i take your code out, i get redirected to the right page,, weird, any ideas
Thanks
|
|
|
 |
ghtracey
Posts: 23
|
| Posted: 06/08/2004, 12:38 PM |
|
A 500 would be a code issue (obviously ) but like I said I don't do ASP. I took that mostly from the help file. Maybe one of the ASP gurus can help you.
_________________
Graham Tracey
Council of Yukon First Nations |
 |
 |
|