php - Take user back to previous page after logging in? -


i have controller called accounts, views signin , signout.

the corresponding functions this:

function signin() {     if (!empty($this->data))      {         //handle login         ...         //save login session         $this->session->write('account',  $data["account"]);         //redirect previous page         ???     } }  function signout() {     //delete login     $this->session->delete('account');     //redirect previous page     ???  } 

if user goes accounts/signin first checks see if form submited if(!empty($this->data)) if yes, logs them in, if not renders signin form. if succesfully log in, want redirect them page @ before signin page.

whats best way that?

edit:

i not think can user regular http referrer because technically referrer signin in page because go /signin, submit sign in form. @ point form submited referrer /signin. want redirect before that. make sense?

http://book.cakephp.org/view/430/referer

use hidden <input> field holds initial referrer , gets submitted login data.


Comments

Popular posts from this blog

java - SNMP4J General Variable Binding Error -

windows - Python Service Installation - "Could not find PythonClass entry" -

Determine if a XmlNode is empty or null in C#? -