iFrameから別のiframeにデータを送信するには、cURLを使用する必要があります。私のコードは次のとおりです。 php curlあるiframeから別のiframeにデータを送信する
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>New Web Project</title>
</head>
<body>
<form action="postback.php" method="POST">
<input type="hidden" name="variable" value="send"/>
<input type="submit" />
</form>
<iframe name="test" src="postback.php" width="200" height="200"></iframe>postback
<iframe name="test2" src="replay.php" width="200" height="200"></iframe>replay
</body>
</html>
と2のiframeコード: ポストバックはiframe:
<?php
if (isset($_POST["variable"])){
$var1 = $_POST["variable"];
$url = 'http://localhost/xss/replay.php';
$ch = curl_init($url);
$parameters = 'variable2='.$var1;
//curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $parameters);
curl_exec($ch);
curl_close($ch);
}
else echo 'w8';
?>
リプレイはiframe:
<?php
if (isset($_POST["variable2"])){
$var1 = $_POST["variable2"];
echo $var1;
}
else echo 'w8';
?>
この場合、私はsecound IFRAME(リプレイからの応答を取得します.php)を印刷変数2の代わりに新しいページに置き換えてiframeを削除します。どうすれば変更できますか?私は、JavaScript/AJAX/jQueryのectを使用することはできないと付け加えます。サーバー側のスクリプトのみ
カールを使用して探しているものを達成することができると思ういけません2番目のもの。しかし、呼び出しでは、表示されているスクリプトではなく、そのスクリプトの完全に別のインスタンスを使用しています。 – mishu
はい、まさに私がしたいことです。私はiframe1のボタンを起動し、iframe2のresult(echo)を見たいと思います。問題は、各iframeが異なるドメインにあることです。 – Krystian
あなたは、curl呼び出しでその2番目のURLからの出力を取得します..あなたはそれのための別のiframeを必要としません..最初の(そして唯一のiframe)の初期状態を表示し、呼び出し後にカールの応答を表示 – mishu