我正在使用PHP创建视频站点,并且想从PHP URL插入视频源代码。
例如,如果我想从PHP中获取第1集,则需要这样:
example.com/player.php?=episode1
第2集:
example.com/player.php?=episode2
我不明白如何将所有源页面与主索引页面链接起来。
我如何完成此任务?
答案 0 :(得分:0)
您可以采用以下方法:在首页(index.html
?)上使用表格来选择所需的视频,然后使用GET方法将其发送到player.php
。然后在player.php
上使用以下内容:
<?php
$select = $_GET['select']; //This will be the number input for the video number
echo("<video><source src="episode$select.mp4"></video>"); //This will source the video named `episodeX.mp4`, where `X` is the select value from the form on `index.html`.
?>
请问您是否需要任何其他说明。