CodeCharge Studio
search Register Login  

Web Reports

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

YesSoftware Forums -> Archive -> GotoCode Archive

 custom login

Print topic Send  topic

Author Message
gina
Posted: 09/30/2002, 9:32 AM

In code charge studio (PHP4), I have the typical login page. When you enter a wrong password or user name, the error message "Login or Password is incorrect" will appear right above the login field. Instead, if a user enters the wrong user name or password, I would like them to be redirected to a different login page that will ask the user to re-enter their user name and password. Is there any way to redirect the user to a different page if they enter incorrect login information? Thanks
Mehmet Ozdemir
Posted: 09/30/2002, 3:18 PM

While I'm using ASP (Templates) the same theory should apply to you.

The Login calls the following code snippet:

If NOT CCLoginUser(.login.Value, .password.Value) Then
.Errors.addError("Login or Password is incorrect.")
Login_DoLogin_OnClick = False
.password.Value = ""
Else
If Not IsEmpty(CCGetParam("ret_link", Empty)) Then _
Redirect = CCGetParam("ret_link", Empty)
Login_DoLogin_OnClick = True
End If

Now instead of:
.Errors.addError("Login or Password is incorrect.")
replace that with:
Redirect = the page you want to redirect to.

HTH
Mehmet Ozdemir
Nicole
Posted: 10/03/2002, 1:12 AM

Gina,
here is PHP version.
Open file with the events for Login page, find
function Login_DoLogin_OnClick()
and modify the following part of code:
global $Login;
if(!CCLoginUser($Login->login->Value, $Login->password->Value))
{
$Login->password->SetValue("");
header("Location: AnyPage.php");
return false;
}
else
ot get something like:
global $Login;
if(!CCLoginUser($Login->login->Value, $Login->password->Value))
{
$Login->Errors->addError("Login or Password is incorrect.");
$Login->password->SetValue("");
return false;
}
else
WillJ
Posted: 10/03/2002, 10:32 AM

Maybe I am thinking to simplistic but why don't you just change the generated HTML message to say "Login or Password is incorrect please try again", and turn off the generate html capability the codecharge environment.

   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

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.