OLD | NEW |
1 <?php | 1 <?php |
2 if ($_GET["suborigin"]) { | 2 if ($_GET["suborigin"]) { |
3 header("Suborigin: " . $_GET["suborigin"]); | 3 header("Suborigin: " . $_GET["suborigin"]); |
4 } | 4 } |
5 ?> | 5 ?> |
6 <!DOCTYPE html> | 6 <!DOCTYPE html> |
7 <html> | 7 <html> |
| 8 <head> |
| 9 <meta charset="utf-8"> |
| 10 </head> |
8 <script> | 11 <script> |
9 window.secret = ''; | 12 window.secret = ''; |
10 window.onmessage = function() { | 13 window.onmessage = function() { |
11 var iframe = document.getElementById('iframe'); | 14 var iframe = document.getElementById('iframe'); |
12 var secret; | 15 var secret; |
13 try { | 16 try { |
14 secret = iframe.contentWindow.secret; | 17 secret = iframe.contentWindow.secret; |
15 } catch (e) { | 18 } catch (e) { |
16 secret = e.toString(); | 19 secret = e.toString(); |
17 } | 20 } |
18 parent.postMessage(secret, '*'); | 21 parent.postMessage(secret, '*'); |
19 }; | 22 }; |
20 </script> | 23 </script> |
21 <?php | 24 <?php |
22 if ($_GET["childsuborigin"]) { | 25 if ($_GET["childsuborigin"]) { |
23 echo "<iframe id=\"iframe\" src=\"post-to-parent.php?suborigin=" . $_GET["ch
ildsuborigin"] . "\"></iframe>"; | 26 echo "<iframe id=\"iframe\" src=\"post-to-parent.php?suborigin=" . |
| 27 $_GET["childsuborigin"] . "\"></iframe>"; |
24 } else { | 28 } else { |
25 echo "<iframe id=\"iframe\" src=\"post-to-parent.php\"></iframe>"; | 29 echo "<iframe id=\"iframe\" src=\"post-to-parent.php\"></iframe>"; |
26 } | 30 } |
27 ?> | 31 ?> |
28 </html> | 32 </html> |
OLD | NEW |