I am consequently running two php pages in the browser. Two php pages in two tabs of a browser. First php page has a button and Second php page has a Jquery that runs a function when the first php button is pressed.
I want the Jquery that is implemented in Second php page to be notified, such that the Jquery after getting notified that a button has been pressed, will reload the Second php's page (Jquery's current page). I am trying to make the Jquery receive the message from the button press but it seems it's not able to receive any. What am I doing wrong?
DownloadButton.php
<?php
if(isset($_POST['submitGenZip']))
{
header('Location:GenerateZip.php');
}
?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Zip Files</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" />
</head>
...
...
...
<tr>
<form action="" method="post" role="form">
<td>
<input type="submit" name="submitGenZip" class="btn btn-primary" value = "Generate Zip" style="float: right;">
</td>
</form>
</tr>
...
...
NotificationPage.php
...
...
...
<script>
$("#submitGenZip").click(function()
{
$(this).data('clicked', true);
if($("#submitGenZip").data('clicked'))
{
location.reload();
}
});
</script>