Jump to content

In Line Form Handling


tetuanrp

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.