CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> Tips & Solutions

 Creating Custom Session Variable upon Login

Print topic Send  topic

Author Message
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
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.