kasni84
Posts: 16
|
Posted: 10/08/2011, 1:14 AM |
|
I'm new with CCS and need help. i read the help and follow Solution>CCS example but the instruction doesn't show clearly.
1. How to redirect user to another page based on their groupid?
2. Once reach on the redirected page, how to load the data based on username? (how to add sql select * from tableA where username LIKE {username} ?) how to pass parameter username so that the redirected page will show details for logged user?
3. how to log out a user? i did use the authentication builder but the parameter doesn't go username=nameOfTheUser?Logout=True.
|
|
|
datadoit
|
Posted: 10/08/2011, 5:34 AM |
|
Welcome aboard! Take some time to get acquainted by going through the
QuickStart Tutorial: http://docs.codecharge.com/studio40/QuickStartTutorials.pdf
|
|
|
kasni84
Posts: 16
|
Posted: 10/08/2011, 8:08 AM |
|
thanks for replied. i followed the if else groupid redirect but got looping error. what i'm understand now is that its better to navigate where the user should go then redirect to login page if they not login yet. then to logout i have to redirect them to a new page n send parameter. but now how to disable button if value=data on table? i want to make a one time insert data only.the next time user came back, the button is disable or hide.
|
|
|
benjohn
Posts: 30
|
Posted: 10/12/2011, 4:21 PM |
|
hi there kasni84,
Good Day!
for item 1: say after logging in your landing page is home.php; you could use the AfterInitialize event of the page to redirect wherever you want
global $Redirect;
if(CCGetGroupID() == 1){
$Redirect ="page1.php";
}if(CCGetGroupID() == 2){
$Redirect ="page2.php";
}
for item 2: load user information, you could drop a grid with the parameter username = UserLogin defined as a session. i would however suggest you use ID instead. so it would be userid=UserID again defined as a session
for item 3: you do not need to specify the username. say you dropped a logout action on the page index.php. so all you have to do is create the link index.php?Logout=True
hope this helps... all the best!
pal,
Benjohn
_________________
~=~=~=~=~=~=~=~=~=~=~=
get it done. make it happen.
~=~=~=~=~=~=~=~=~=~=~= |
|
|
kasni84
Posts: 16
|
Posted: 10/18/2011, 5:24 PM |
|
Thanks benjohn, using redirect by groupID solved the looping problem.
|
|
|