The solution is simple, you simply implement:
After uploading the file you can redirect the user to the video page and to the file that has the iframe knowing which video is being "requested" you use Query String
:
<?php
include("conexao.php");
$msg = false;
if(isset($_FILES['arquivo'])){
$extensao = strtolower(substr($_FILES['arquivo']['name'], -4));
$novo_nome = md5(time()) .$extensao;
$diretorio = "animes/";
move_uploaded_file($_FILES['arquivo']['tmp_name'], $diretorio.$novo_nome);
$sql_code = "INSERT INTO arquivo (codigo, arquivo, data) VALUES (null, '$novo_nome', NOW())";
if ($mysqli->query($sql_code))
$msg = "Arquivo enviado. <a href='gerador_paginas.php?video=".$novo_nome."'>Clique aqui</a> para gerar o HTML";
else
$msg = "Falha ao enviar.";
}
?>
After that, you retrieve the URL of the file to be displayed from the URL:
<?php
$novo_nome = $_GET['video'];
$arquivo = fopen($novo_nome, "w");
$texto = "<!DOCTYPE html>
<html lang=\"en\">
<head>
<meta charset=\"UTF-8\">
<title></title>
</head>
<body>
<iframe src=\"upload/animes/$novo_nome\" frameborder=\"0\"></iframe>
</body>
</html>";
fwrite($arquivo, $texto);
?>
And also you can create as a playlist, listing the videos and always redirecting to your_page.php? video = VIDEO_NAME
One tip I recommend is never to use names in Query String
as this can be a problem up front for you. It would be nice to use the ID of the record inserted in the database for that video, then you get the ID via Query String and query in MySQL to return the name of the video.
I do not understand the need only to create an html file containing the iframe, because if you have many videos, it will create many files on your server. If you just want to let the user upload the video and then leave that video accessible, just create a page that takes the query string and mount the HTML without saving a new file on your server, going something like this:
<?php
$novo_nome = $_GET['video'];
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<iframe src="upload/animes/<?php echo $novo_nome;?>" frameborder="0"></iframe>
</body>
</html>