ThePs
ThePs

Reputation: 13

Empty iframe after submitting the form

Im now learning .php and want to try some basic form. As I created the form for getting embed link from user (youtube), but after submitting the form the iframe content is empty. If anyone knows the cause, please kindly guide me :)

<FORM method = 'post' action = 'a.php'>
<input type="text" name = "embed" id= "embed"></input>
<br><input type = 'submit' value = 'Go'>
</form>

<?
echo $_REQUEST['embed'];
?>

Upvotes: 0

Views: 271

Answers (1)

Tomasz W.
Tomasz W.

Reputation: 422

Please try this code, it worked for me. I put everything in one index.php file.

<?php echo $_REQUEST['embed']; ?>

<form method='post'>
<input type="text" name="embed" id="embed"></input>
<br><input type='submit' value='Go'>
</form>

Upvotes: 1

Related Questions