wkempees
Posts: 1679
|
Posted: 05/26/2008, 12:26 PM |
|
How to Lookup a value upon succesful login and store it in a session variable the CCS-way,
upon pressing the login button. (As opposed to doing it on a landing page)
Based on the Internet Example Database.
Table: users
Field to lookup: first_name
lookup field: currently logged in user
table key field: user_id
Open the properties->Events for the login button, it should already have one action attached: Login.
Add an action: DLookup, it should appear below the Login action,
if not right clock the Dlookup and select 'move down'
Set:
Expression: 'first_name'
Domain : 'users'
Criteria: "user_id=". CCGetUserID()
Connection: <choose from dropdownlist your current connection>
Convert result: Integer
Type of target: Session
Target: sess_firstname
That should do it, tested.
A way to test this (PhP) is to add a label to a page, BeforeShow set it to $Component->SetValue( CCGetSession("sess_firstname","XXX") );
Take care to use correct names and caps!
Walter
_________________
Origin: NL, T:GMT+1 (Forumtime +9)
CCS3/4.01.006 PhP, MySQL .Net/InMotion(Vista/XP, XAMPP)
if you liked this info PAYPAL me: http://donate.consultair.eu
|