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 -> PHP

 [RESOLVED] Redirection @ login based on group ~ user, admin, etct..

Print topic Send  topic

Author Message
wcboyd


Posts: 46
Posted: 02/06/2008, 9:43 AM

Hello All,

I am trying to figure out how to send those who belong to the "user" group to pageA.html or if they belong to "admin" group send them to pageb.html.

I know how to do a single static redirect at login, but this conditional thing has me stuck.
I have searched the forums and there does not seem to be a clearly defined way to do this.

<edit> Ideally, I would like to drive the page they are being redirected to by a field in the group table called "homepage", for the sake of argument.

Any ideas anyone?


_________________
Thanks,

Craig

"Stress is the body's way of saying you have not worked enough unpaid overtime." ~ Scott Adams
View profile  Send private message
waqasaltaf

Posts: 37
Posted: 02/06/2008, 12:28 PM

hi..
try this

Put the following custom code in the before show event of your redirect page.

//Custom Code @2-1360E090
if(CCGetSession("GroupID") == "")
{
header("Location: login.php");
}
elseif (CCGetSession("GroupID") == 1)
{
header("Location: group_one.php");
}
elseif(CCGetSession("GroupID") == 2)
{
header("Location: group_two.php");
}
//End Custom Code

what i did was create a page say pg2 and put this code in that page
i redirected the login page to this page and then this script will do the rest.
View profile  Send private message
wcboyd


Posts: 46
Posted: 02/06/2008, 2:03 PM

That does the trick nicely!

_________________
Thanks,

Craig

"Stress is the body's way of saying you have not worked enough unpaid overtime." ~ Scott Adams
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.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


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