I have a function that allows a user to deactivate their account. I want it so that when they’ve clicked the deactivate my account link which opens up in an iframe to refresh the entire browser or refresh the parent page so that the site recognises they are no longer logged in?
This is the link placed in the iframe:
<a href="close_account.php?account=<?php echo $_SESSION['user_id']; ?>">De-activate My Account & Profile</a>
Here’s my function code:
<?php
require_once("includes/session.php");
require_once("includes/functions.php");
require('includes/_config/connection.php');
hide_account($users); ?>
So all of this happens in an iframe and once the user clicks the button they get redirected to the login page but this happens within the iframe and i don’t want them to be able to close the iframe and still have their account logged in from the parent page so the browser or page needs to refresh somehow which will cause the iframe to close and them automatically be redirected to the login page?
Any advice would be great. Thanks
You could set the
targetproperty of the<a>to_top, in order to open the link in the parent page.HTML target Attribute in W3School