我正在尝试创建人们可以输入视频 URL 并将其保存到我的数据库中的地方。问题是,在我将视频 url 保存到我的数据库后,如何使用 PHP 在页面上显示它?
例如,使用这个嵌入的 vimeo 视频,我如何在从我的数据库中调用它之后显示它。
如果我想像这样从数据库中显示它:
$result = mysqli_query($connect,"SELECT * FROM web where video <> '' && video IS NOT NULL");
if ($row = mysqli_fetch_array($result))
{
我怎样才能显示这个?
<iframe src="https://player.vimeo.com/video/90312869" width="500" height="281"
frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen>
</iframe>
<p><a href="https://vimeo.com/90312869">360°
Video using 6 GoPro Cameras - spherical panorama timelapse</a>
from <a href="https://vimeo.com/j0n4s">j0n4s</a> on <a href="https://vimeo.com">Vimeo</a>.</p>
像这样:
$result = mysqli_query($connect,"SELECT * FROM web where video <> '' && video IS NOT NULL");
if ($row = mysqli_fetch_array($result))
{
$url = $row['url'];
}
<iframe src="<?php echo $url; ?>" width="500" height="281"
frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
<p><a href="<?php echo $url; ?>">360°
Video using 6 GoPro Cameras - spherical panorama timelapse</a>
from <a href="https://vimeo.com/j0n4s">j0n4s</a> on <a href="https://vimeo.com">Vimeo</a>.</p>
我是一名优秀的程序员,十分优秀!