Refresh a page after submitting PHP

1

I want to refresh my page after clicking a button that is in a popup. This is the popup page form.

<form method="POST" action="_cal.php" >
        <input type=submit value=Fechar onclick=window.close()>
</form>

When I click on the close of the popup, I want to update my "_cal.php" page.

    
asked by anonymous 03.11.2014 / 13:42

2 answers

2

In the popup, indicate in the onunload event (which will be triggered when you close the popup) for the parent page to be reloaded.

<body onunload="window.opener.location.reload()">
    
03.11.2014 / 13:50
2

Here's an adapted alternative to a SOzão answer :

This code is an interesting alternative if you want the control to be the window that opens the popup , rather than the popup itself. >

function pop() {
  var child = window.open('http://ddg.gg', '','toolbar=0,status=0,width=400,height=200');
  var timer = setInterval( CheckChild, 500 );

  function CheckChild() {
    if (child.closed) {
      alert("Aqui voce recarrega a pagina");
      clearInterval(timer);
    }
  }
}

See working at JS Fiddle .

Just change the line from alert to desired window.location .

    
03.11.2014 / 13:52