DenMaki DenMaki - 5 months ago 47
PHP Question

How to go back to previous page with retain the ID's in URL Codeigniter

this is my always code in go back

<a href="<?=site_url($controller)?>"><i class="icon-chevron-left"></i> Go Back</a>
<br><br>


My question is that how can i back to my previous page that my retain my id in my previous page like this....

This is my previous page:
scms/contracts/serial/3

This is my current page:
scms/contracts/view_pm/3/Monthly

----I want to go back to "/scms/contracts/serial/3"

Answer

https://developer.mozilla.org/en-US/docs/Web/API/Window.history

<a href="#" onclick="window.history.back();">Go back</a>