I want yo post a data, post data will be show in iframe.
my Html code working good. how to do this in react.
<iFrame src="https://127.0.0.1/iframe_post/test.php" name="hidden_iframe" height="300" width="500"></iFrame>
<form id="loginForm" target="hidden_iframe" action="http://127.0.0.1/iframe_post/test.php" method="POST">
<input type="text" name="j_username" value="login" />
<input type="text" name="j_password" value="password" />
<input type="submit">
</form>
<?php
$name = $_POST["j_username"];
$pass = $_POST["j_password"];
echo $name;
echo $pass;
?>
Note: in react, any form not available. iframe available with out srcDoc(like in html) just React.useEffect will post a data & data will be show in iframe. how to load iframe with POST response.