0
I wanted to do more or less like Youtube, where you fill out the form and then you create a page with your video (my site will also contain videos), I’ve done the uploading part but I have no idea where to start to generate a page automatically. Could you tell me a programming language for this or if I can do it by php itself?
Upload:
<?php
include("conexao.php");
$msg = false;
if(isset($_FILES['arquivo'])){
$extensao = strtolower(substr($_FILES['arquivo']['name'], -4));
$novo_nome = md5(time()) .$extensao;
$diretorio = "upload/";
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";
else
$msg = "Falha ao enviar.";
}
?>
<?php
if ($msg != false) echo "<p> $msg </p>";
?>
<form action="upload.php" method="POST" enctype="multipart/form-data">
Arquivo: <input type="file" required name="arquivo">
<input type="submit" name="Salvar">
</form>
What is this Youtube page you refer to?
– Victor Eyer
The upload page, where you fill in the information like title, description and upload the video.
– Toniotti
It can show what you have already developed?
– user60252
Just the same upload, a very simple system to upload files.
– Toniotti
if you don’t show some code, they will close your question
– user60252
Okay, I’m new here, just paste the code here?
– Toniotti
click edit and paste your code
– user60252
Look I guess it didn’t work out so much just paste the code huh
– Toniotti
hit your code
– user60252
then, create a file cabecario.php and a file rodape.php that will be included in the page that will run the video
– user60252
But when someone uploads I wanted to automatically create a page containing the video, as if it were a blog post.
– Toniotti
Then, after you create a page including these two files, which will characterize a single template for the page, only differentiating the content. The content will be composed of the video that the user send
– user60252
So, in this part I thought about just leaving a code ready and I wanted that when the page was created to change the src of an iframe, so it would be simpler, my problem is how to make a page be created automatically with this code after the form is sent.
– Toniotti
ai becomes very extensive and complicated explain through comments
– user60252
But could you just tell me a programming language or something to research?
– Toniotti
PHP is a good option
– user60252
Thank you see if I find something
– Toniotti