Jump to content

Redirect From An Unsuccessful Login


podarum
 Share

Recommended Posts

I know you guys know this... but, I have a login box on my main page and in Dremweaver you can specify if it is a successful login then go to page ABC.php and if unsuccessful then go to page DEF.php.. but instead of a page DEF.php, I just want a quick pop up box saying the login credentials were unsuccessful.. I'm having problems wiht this pop up box... Thanks

Link to comment
Share on other sites

For the code below instead of re-directing it to the ContactUs.php page.. I want a popup box .

  $MM_redirectLoginSuccess = "ProfileForm2.php";  $MM_redirectLoginFailed = "ContactUs.php";  $MM_redirecttoReferrer = false;

an I'd like to insert somehing like

<script>alert('Your username and/or password does not match our records. Please try again.')</script>

instead of "ContactUs.php"

Link to comment
Share on other sites

It sounds like you're using somebody else's software for this.I'd send the login data with AJAX and check the result, if it was successful I would redirect and if it failed I would show the popup window.

Link to comment
Share on other sites

All you've shown us is this:

  $MM_redirectLoginSuccess = "ProfileForm2.php";  $MM_redirectLoginFailed = "ContactUs.php";  $MM_redirecttoReferrer = false;

These are just variables. The rest of the software is what's actually doing the redirecting. Since you don't seem to know how the software is redirecting the page I was assuming it was because somebody else made it for you.As for making a popup box appear, you can send the login data with AJAX. If the server sends a success message, redirect with window.location. If the server sends an error message, make Javascript create the popup box you wanted.See:W3Schools AJAX tutorialW3Schools PHP / MySQL tutorial

Link to comment
Share on other sites

Thanks Ingolme... see that's my problem I have no idea on how to do that.. I mean I have inserted a popup box wiht an error message but that is located on a separate page... for example if you go to my site www.risksolutions.ca and on the right hand side, you insert an wrong username and password (try it), you get a popup box, but with another page as well, and I don;t want that page... You'll see what I mean.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...