php - Serverside redirect from iframe not working in Firefox and Chrome but works in IE6 -
i love know why following not work in firefox 21 , chrome 26 yet works in ie 6.
i have page "frame.html" contains iframe.
the iframe points page "post.html".
post.html contains form posts username server php page "redirect.php".
the server responds redirect google.
in ie6 google page appears in iframe, in firefox , chrome doesn't.
does know why happens , if it's possible in modern browser?
thanks.
frame.html
<html> <head> <title>frame</title> </head> <body> <iframe width="800" height="800" src="post.html"/></iframe> </body> </html>
post.html
<html> <head> <title>post</title> </head> <body> <form action="http://myserver.com/redirect.php" method="post"> <input type="text" name="username"/> <input type="submit" value="send"/> </form> </body> </html>
redirect.php
<?php header('location: http://www.google.com'); exit; ?>
modern browsers have cross domain protection builtin.
for instance. google chrome logs message console:
refused display 'http://www.google.nl/' in frame because set 'x-frame-options' 'sameorigin'.
if use page on domain work.
Comments
Post a Comment