I have a reporting website that I maintain. I have it setup so that users can select a row and be taken to a form to edit parts of it. After making the edits the user will click the "Submit" button and then a query is run against the SQL DB to update the record in the DB. I want the page to then go back to the referring page. I know that there's a way to do that with javascript something like parent.history.go(-1);
, but I don't know how to implement it.
Basically, after the $sth->execute();
I want something that will send the parent.history.go(-1);
.
I was trying to use header('Location:')
but that would only work if they had not done a search on the previous page (or any filtering or ordering). If I could have it just go back to the previous page, or maybe even reload the previous page so that their edits show up too that would be great.
You can use
header('Location: '.$url)
along with state saving in jQuery DataTables (since your question is taggeddatatables-1.10
) withstateSave
option.For example:
It will save/restore table sorting, filtering and page so that when the same page is visited again the table will have previous state restored.