把php变量放在src html上

时间:2017-09-29 15:26:11

标签: javascript php html ajax

我想放置代码,在iframe网址上打印代码

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 } ?>

1 个答案:

答案 0 :(得分:0)

我相信这就是你想要的:

&#13;
&#13;
<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 } ?>
&#13;
&#13;
&#13;