...

View Full Version : Submitting a form in an iframe?



Taipan
01-10-2007, 12:13 AM
I know there are lots of topics on this subject, I just can't get my code to work. I am using php/mysql. On my website I have a member area where you can login. Once logged in I have a link to a control panel on a 3rd party website that loads into an iframe. The first page to load into the iframe is a login page. But once the member is logged in to my site, the username and password for the other site is known so I would like to submit the login form so the control panel loads up straight away. But I have no idea how to submit the form on the site loaded into the iframe.

The code of the form loaded into the iframe is

<form name="form1" method="POST" action="/cp/index.php?do=">
<table border="0" align="center" cellpadding="8" background="images/bg_ltgrey.gif">
<tr>
<td colspan="2"><center><h2 class="title">Login</h2></center>
</tr>
<tr>
<td align="right" valign="middle" >Phone Number</td>
<td><input name="username" type="text" id="username"></td>
</tr>
<tr>
<td align="right" valign="middle">Password</td>
<td><input name="password" type="password" id="password"></td>
</tr>
<tr>
<td colspan="2"></td>
</tr>
<tr valign="bottom">
<td colspan="2"><div align="center">
<input type="image" src="images/loginbutton.gif" name="Submit" alt="Login">
</div></td>
</tr>
<tr>
<td colspan="2">&nbsp;</td>
</tr>
<tr>
<td colspan="2"><div align="center"><a href="/cp/index.php?do=lostPassword">Forgotten your password?</a></div></td>
</tr>
</table>
</form>

Can anyone give me a hint how I would pass on "username", "password" and submit the page when the iframe is first loaded?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum