I’ve got a problem. I have got two servers on first I’ve got my whole db with login page, and on secoud one I’ve got my WWW page. Those servers are on diferent domains. I build site, where is 2 iframes, each iframe respectively from first and secoud server. When I submit form the results are opening in new tab instead of place results in the secound one. Belowe is code. I will add only that, on IE it works good.
secound server
index.html (this is the main frame)
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>New Web Project</title>
</head>
<body>
<iframe name="vforms1" src="vforms.php" width="200" height="200"></iframe>
<iframe name="map1" src="http://xxx.xxx.xxx/map.php" width="200" height="200"></iframe>
</body>
</html>
vforms.php
<?php
if (isset($_POST["variable"])){
$var2 = $_POST["variable"];
echo $var2;
}
else echo 'waiting';
?>
first server
map.php
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Test page</title>
</head>
<body>
<form action="http://xxx.xxx.xxx/test/vforms.php" method="POST" target="vforms1">
<input type="hidden" name="variable" value="send"/>
<input type="submit" />
</form>
</body>
</html>
I am working on that since last friday, and try to do everything! Now it’s realy drive me crazy! Can anybody help me?
Cheers!
Because it is on a different domain, there are cross domain policies in place. The
<form>does not know about the other iFrame, and cannot access it. Neither can it access it’s parent.So, there really is no option on how to fix it, other than remotely connecting to the database with php, and removing the iFrames all together (which is a bad thing in the first place)