Jump to content

Recommended Posts

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

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.