CodeCharge Studio
search Register Login  

Visual Web Reporting

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

YesSoftware Forums -> Archive -> GotoCode Archive

 redirect based on security and php - please help!

Print topic Send  topic

Author Message
tried everything
Posted: 10/28/2002, 2:00 PM

I am using php4 w/ templates and am trying to make a successful redirect page that will redirect the user based on security level. First, I created a redirect page, and in the before show event, I inserted this code:

if (CCGetSession("GroupID") == 1)
header("Location: trialmenu.php");
if (CCGetSession("GroupID") == 2)
header("Location: membermenu.php");
if (CCGetSession("GroupID") == 3)
header("Location: adminmenu.php");

What happens, is, when I go to login, I don't get redirected to the page requested, instead, the redirect page opens up with the header and footer. I tried inserting the code from http://kabwebs.com/ccsniplets/sniplets_view.php?RecNo=7, which is this:

//Custom Code @28-2A29BDB7
if (CCGetSession("GroupID") == 3)
header("Location: adminmenu.php);
//End Custom Code

When I tried this and tried to publish the page, it kept on commenting everything out, so I did it without the "//Custom Code @28-2A29BDB7". This helped by not commenting everything out, but it still took me to the redirect page after logging in, without redirecting me. can anyone please help? thanks!
Nicole
Posted: 10/30/2002, 5:56 AM

Hello,
You should edit the value of $Redirect variable in the loginformname_DoLogin_OnClick() function, namely under the else section:
else
{
if (CCGetSession("GroupID") ==1)
$Redirect = "page1.php";
if (CCGetSession("GroupID") ==2)
$Redirect = "page2.php";

}

   


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.