![]() |
referrer solution (previous uri) - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: referrer solution (previous uri) (/showthread.php?tid=55019) |
referrer solution (previous uri) - El Forum - 10-05-2012 [eluser]GrahamDj28[/eluser] Hi All! I have seen a lot of people using http_referer for redirecting to a previous page. But I have also read that this is not reliable, as it is not always set and can easily be injected with fake information by the client. Needing a solution I have come up with this. I have extended the CI_URI class by creating a MY_Uri.php Copied the _reindex_segments method form the original class and added it to MY_Uri.php Code: public function _reindex_segments() { Now if I want to return to the previous page I can just call Code: $_SESSION['prev_url'] Thanks! |