Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Codeigniter | Get previous URL and used as back button to previous page

I really wonder how can I do this, I have 3 pages that has the same link going to 1 page, now what I want to do is to have 1 button that is intelligently enough to get which of the 3 pages was used to go to that page and used it as it's link going back to that previous page.

Please if anyone who knows how to do this, help me to get out to this chaos. post some code how to do it in codeigniter. Thank you in advance.

like image 886
Dennis Avatar asked Aug 30 '25 16:08

Dennis


1 Answers

By using a simple javascript to achieve previous button like,

<a href="javascript:window.history.go(-1);">Previous</a>
like image 194
Vinod VT Avatar answered Sep 02 '25 06:09

Vinod VT