I am loading a page to change passwords within an iframe. Outside the iframe it does work well, but when I change the password from within the iframe it returns a blank page. How can I rectify the problem?

//iframe
<div class="tabber">

     <div class="tabbertab">
	  <h2>Eguard</h2>
	  		<iframe src="eguard.php" width="100%" height="400">
			</iframe>

And if you can help me auto resize(height) the iframe also. ;)

Member Avatar for diafol

Why are you using an iframe. Can't you just use an include file? This login form is yours right?

If external: you could 'spoof' the form and send it as a native. However, this falls apart when the external form owner decides to change things.

The login form is mine.
It is used to login in to level 2 of the website. And this is done from the homepage. So I thought it's better done in an iframe in the homepage.

Member Avatar for diafol

OK Brian, could I suggest that you use an include file for this? There really is no need to use iframes these days - well for 99% of uses anyway. That's how I'd do it anyway.

e.g.

includes/loginform.php

<form ...>
...your form...
</form>

mainpage4.php

...first bits of the page...
<?php
if(isset($_SESSION['login']) && $_SESSION['loginlevel'] < 2){
  include("includes/loginform.php");
}
?>
...rest of the page...

I think this is pretty standard stuff.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.