【发布时间】:2014-01-17 08:42:36
【问题描述】:
大家好,我需要帮助。我正在使用一个小的 php 脚本,其中添加了 HTML 5 视频标签。
这部分代码用于调用下载函数:
<?php print ("<a href='download.php?f=" .$f ."'><img src='" . img . "/" . $f . ".jpg' width= '440' height= '272'></a>"); ?>
<?php echo $string; ?>
<?php print("<a href='download.php?f=" .$f ."'>"); ?><img src= "http://example.com/images/button.jpg"> </a>
</ul>
<div class="black_right clearfix" style="">
<div class="text_91" style=""></div></div>
<h1><?php echo "$f" ?></h1>
这是视频代码:
<video width= "300" height= "250" controls>
<source src= "http://www.example.com/photos/$f" type= "video/mp4">
</video>
我在这里寻找的是可以从文件夹中调用这些视频的代码,就像使用文件夹“img”中的 $f 调用缩略图一样。
【问题讨论】:
-
我想用这样的东西。
我试过了,但它不起作用。 -
找不到支持格式或 MIME 类型的视频
-
你是否在 $f 中输入了有效参数?我看到你的第一个图像标签有“.img”。没有'$'是常量还是变量?
-
img 是一个文件夹。我已经在这里编写了代码,这就是我正在使用的全部内容。
-
那么如果文件夹名称为 'img',你为什么将它用作 PHP 常量? “”。在双引号中可以直接使用 php 变量。