is there other way to use iframe for showing the retrieved mysql database query result?
i have these codes now but it’s not working,
<iframe id="editor" style="width:500px; height:300px;" value="<?=$textContent?>"></iframe>
but when i tried it on textarea, it shows the query result.
<textarea value="<?=$textContent?>"> </textarea>
here’s my database query if it would be helpful,
<?php
// Connect to server and select database.
$query="SELECT * FROM text_tb WHERE textID ='".$textID."'";
$result=mysql_query($query);
while($row=mysql_fetch_array($result)) {
$textID = $row['textID'];
$textContent = $row['textContent'];
}
?>
thank you for the help.
If the PHP code is running on the same page as the iFrame you want, you are going to have to use JavaScript to “inject” the HTML into it.
You can also put that PHP code in a different page, and set the iFrame’s “src” to that URL.
results.php
main page