Faxsy Faxsy - 5 months ago 8
PHP Question

Iframe form should open new page

I have a login box showed as iframe

<div id="auth-container" >
<iframe src="loginiframe.php" width="100%" height="100%" frameBorder="0">Browser not compatible.</iframe>
</div>


Now inside the loginiframe.php there is a form submit

<form action="auth.php">


where I process my request , and I would like to redirect to another page after process but now

When submit is clicked the auth.php it process the request and redirect to next page but showed in the iframe

I would like to redirect them to account.php page

daf daf
Answer

Your auth.php page could redirect to another page with the following script block:

<script type="text/javascript">
window.parent.location = 'home.php';
</script>

assuming that you're redirecting to "home.php" after authentication.

Comments