简体   繁体   中英

MVC Model, CodeIgniter and auth

i am starting to get the hang on the MVC Model, but I still have some questions. This is one of them

I have a website with 6 or 7 main pages. They all share the header view where the logo is, the top menu, the search and, most importantly, a login form consisting of a user and a password text fields, and a submit button.
I want the user to be able to login in any page of the site, and return to the page he was if successful.
What is the best way to call the auth controller to login and make sure the user comes back to the same page (call the correct controller)?

Point login form to the script that handles login process. There, you check login/password against your database for example. If login is successful, redirect user to the page he/she came from with this php call header("Location: {$_SERVER['HTTP_REFERER']}");

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM