syah
Posts: 29
|
| Posted: 03/27/2009, 12:22 AM |
|
i had a problem where when user click link, it will link either add_restaurant page and login page....if the user not already login, when user click the restaurant link it will go to login page...if the user is already login,it will go to add_restaurant page...how i can do that?
this code i add in link before show events
global $Redirect;
global $DBmyData;
if (CCGetUserID()))
{
$Redirect = "add_restaurant.php";
}
else
{
$Redirect = "login.php";
}
|
 |
 |
Gena
Posts: 591
|
| Posted: 03/27/2009, 12:33 AM |
|
Why do you do this manually (and wrong too)???
1. your link to go just to add_restaurant page
2. on your add_restaurant page set "Restricted Property" to yes and select appropriated Groups. Set "Access Denied" Property - Specify the page on which the unauthorized user is redirected, it's your login page.
_________________
Gena |
 |
 |
syah
Posts: 29
|
| Posted: 03/28/2009, 8:27 AM |
|
thanks a lot...
i have done this perfectly......
i don't need to do a coding but just only setting at the properties...
thnks Gena
|
 |
 |
Gena
Posts: 591
|
| Posted: 03/28/2009, 8:49 AM |
|
sure, exactly!
_________________
Gena |
 |
 |
|