Skip to content
Advertisement

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.

Advertisement

Answer

By using a simple javascript to achieve previous button like,

<a href="javascript:window.history.go(-1);">Previous</a>
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement