I am trying to close the window after submitting the form and refreshing the main page and then passing the information in the url for the action popup.
I have some code that works fine, but can not seem to be passing information.
here is the working code
echo "<script>window.close();window.opener.location.reload(true);</script>";
I tried the following, and I know it incorrectly, but I'm not sure where to look for the answer, because I'm not too sure what to look for
<?php
$id=isset($_GET['id']) ? $_GET['id'] : die('ERROR: Record ID not found.');
include '../../../assets/connect.php';
try {
$query = "DELETE FROM investment_return Where id = '$id'";
$stmt = $con->prepare($query);
$stmt->bindParam(1, $id);
if($stmt->execute()){
echo "<script>window.close();window.location.href = window.location.href + '?action=entered';</script>";
}else{
die('Unable to delete record.');
}
}
catch(PDOException $exception){
die('ERROR: ' . $exception->getMessage());
}
?>
As you can tell, I'm trying to append ?action=entereda URL to the end.
The above code closes the window, but does not add the necessary information to the end, an update is not required now because it will be a new URL download.
Thank you very much in advance