-2

I want to do when I put a code, print the code on the iframe url

form method="GET">
  <div>
    Codigo del video que quieres ver: <input type="text" id="ver" name="ver" placeholder="Codigo Video">
  </div>
</body>
</html>
<?php
if ($_GET['ver']) {
echo $ver ?>
<iframe width="560" height="315" src="https://www.youtube.com/embed/<?php echo $image; ?>" frameborder="0" allowfullscreen></iframe>
<?php } ?>
Xtay Gamer
  • 21
  • 4
  • 1
    Turn notcies on. https://stackoverflow.com/questions/670142/how-to-enable-notices-on-my-development-server – rndus2r Sep 29 '17 at 15:29
  • Welcome to SO!. Check out this post on how to ask a question that is likely to be answered: https://stackoverflow.com/help/how-to-ask. I'm really not sure what you are asking here. – Robert Moskal Sep 29 '17 at 15:41
  • What error are you getting? what is $image ? Is iFrame generated? Please explain in more details what is working and what is not working. – Nawed Khan Sep 29 '17 at 15:44
  • The iFrame is successfully generated but we can't put $ver in the url, when I see the code of the web doesn't appear the text that I want to put – Xtay Gamer Sep 29 '17 at 16:07

1 Answers1

0

I believe this is what you want:

<form method="GET">
  <div>
    Codigo del video que quieres ver: <input type="text" id="ver" name="ver" placeholder="Codigo Video">
  </div>
</body>
</html>
<?php
if ($_GET['ver']) {
$ver = $_GET['ver'];
echo $ver;
echo '<iframe width="560" height="315" src="https://www.youtube.com/embed/'.$ver.'" frameborder="0" allowfullscreen></iframe>';
<?php } ?>
HoogleyBoogley
  • 340
  • 2
  • 14