tetuanrp Posted May 11, 2007 Share Posted May 11, 2007 I'm somewhat of a novice in php, so this may be a straight-forward solution. Basically I have a simple login script from a basic .html form, checking a DB, and returning back if the user is legit or not. My form action is the login.php script with checks the user's info. If the user info is not correct, I can send them to a page stating their login info is incorrect, but I'd rather notify them in-line, below the form. Instead of redirecting to a new page. There will be many of these login pages (one per client), and I don't want to have to create a failed-login page for each. Maybe I pass a query string to the login page and reload it? index.php?loginFailed=1. Any easy/commonplace solutions? -R Link to comment https://forums.phpfreaks.com/topic/50878-in-line-form-handling/ Share on other sites More sharing options...
StormTheGates Posted May 11, 2007 Share Posted May 11, 2007 How about just something like this? if($failed == true){ header("Location: failed.php"); } And just have failed.php be the words "You failed" or whatever? Link to comment https://forums.phpfreaks.com/topic/50878-in-line-form-handling/#findComment-250242 Share on other sites More sharing options...
tetuanrp Posted May 11, 2007 Author Share Posted May 11, 2007 The method I ended up using is doing what I mentioned. If the login is correct, the user is redirected using header to the correct page. If failed, then they're redirected back to the same login page, except I add a 'loginFailed=1' to the query string. In the index.php page containing the login form, I check for that variable in the query string, and if it exists then a "You're login information is incorrect" displays. Thanks! Link to comment https://forums.phpfreaks.com/topic/50878-in-line-form-handling/#findComment-250249 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.