plateforme-corres2math/server_files/views/envoyer_video.php

42 lines
1.1 KiB
PHP

<?php
require_once "header.php";
if ($has_error)
echo "<h2>Erreur : $error_message</h2>";
elseif (isset($new_video))
echo "<h2>Votre vidéo a bien été envoyée !</h2>";
?>
<?php
while (($data = $videos_req->fetch()) !== false) {
$link = $data["link"];
echo "<a href=\"$link\">$link</a><br />";
if (preg_match("#https?\://www\.youtube\.com\/watch\?v=(.*)#", $link, $matches)) {
$code = $matches[1];
echo "<center><iframe width=\"560\" height=\"315\" src=\"https://www.youtube.com/embed/$code\" frameborder=\"0\" allow=\"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen></iframe></center><br />";
}
}
?>
<form method="POST">
<table style="width: 100%;">
<tbody>
<tr>
<td style="width: 30%;">
<label for="link">Lien de la vidéo :</label>
</td>
<td style="width: 70%;">
<input style="width: 100%;" type="url" id="link" name="link" />
</td>
</tr>
<tr>
<td colspan="2">
<input style="width: 100%;" type="submit" name="upload" value="Envoyer la vidéo" />
</td>
</tr>
</tbody>
</table>
</form>
<?php require_once "footer.php";