Reload parent shadowbox iframe page without losing POST data

908 Views Asked by At

I have a page where users can edit pictures from a list with filters via POST. When a user edits something it opens in a shadowbox window. Then on submit the parent page reload with this code:

<script type="text/javascript">
noty({"text":"<?php if (isset($_GET["id"])){ echo "Foto modificada con éxito!"; }else{ echo "Foto creada con éxito!"; } ?>","layout":"center","type":"success","animateOpen":{"height":"toggle"},"animateClose":{"height":"toggle"},"speed":500,"timeout":5000,"closeButton":false,"closeOnSelfClick":true,"closeOnSelfOver":false, onClose:cerrar});
function cerrar(){
    window.parent.open('index.php?sec=galerias_de_fotos', '_self');
}
</script>

The problem is that when i reload the parent page i lost the POST values so the filter is lost. I need that the parent page refresh after closing the shadowbox without loosing the filter.

I also tried:

function cerrar(){
  parent.location.reload();
  parent.Shadowbox.close();
}

that works in reloading but not in maintaining POST values. The rare thing is that if i reload with F5 the POST values maintain but not this way.

1

There are 1 best solutions below

3
On BEST ANSWER

A solution is to save the post value in session.