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

 login redirect aint workin

Print topic Send  topic

Author Message
doidom
Posted: 12/20/2005, 11:03 PM

Any reason why code below doesn't work?

Db has three field member_id, login, and password

When I try this I just get redirected to login.php Wierd.

global $Login;
global $Redirect;
if(CCGetSession("login") == "team1")
$Redirect = "http://mysite.com/team1.php";
if(CCGetSession("login") == "team2")
$Redirect = "http://mysite.com/team2.php";
peterr


Posts: 5971
Posted: 12/21/2005, 1:11 AM

May I ask where you are placing that code?
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
doidom
Posted: 12/21/2005, 8:30 AM

On the button_DoLogin > On Click Event > Custom Code
lvalverdeb

Posts: 299
Posted: 12/21/2005, 10:42 AM

From your code, I get the impression that you may have overriden the default CCS session variables of LoginID and GroupID. If you have not then try:

  
global $Login;  
global $Redirect;  
if(CCGetSession("LoginID") == "team1")  
$Redirect = "http://mysite.com/team1.php";  
if(CCGetSession("LoginID") == "team2")  
$Redirect = "http://mysite.com/team2.php";  

or
  
global $Login;  
global $Redirect;  
if(CCGetSession("GroupID") == "team1")  
$Redirect = "http://mysite.com/team1.php";  
if(CCGetSession("GroupID") == "team2")  
$Redirect = "http://mysite.com/team2.php";  

Luis
_________________
lvalverdeb
CR, GMT-6
XAMPP/Ubuntu/CCS3.2/4
View profile  Send private message
peterr


Posts: 5971
Posted: 12/21/2005, 1:17 PM

The event you used looks OK, so the problem may be in your use of session variables as Luis pointed.
"login" is not a standard session variable created by CCS, so this can work only if you renamed GroupID, or created an additional custom session variable.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
doidom
Posted: 12/22/2005, 8:33 PM

My form is named Login
My listboxes are named login and password (corresponding to my db field names)

Any thoughts?
peterr


Posts: 5971
Posted: 12/23/2005, 1:32 AM

Hi again,

In your case there is no relatation to form or listbox names. Try the suggestion provided above by Luis.
You can also view and specify all 3 session variables in Project Settings -> Security -> Advanced.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
doidom
Posted: 12/23/2005, 10:22 AM

Yes that did it. Thanks much!

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.