PHP page generator

Asked

Viewed 193 times

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?

  • The upload page, where you fill in the information like title, description and upload the video.

  • It can show what you have already developed?

  • Just the same upload, a very simple system to upload files.

  • if you don’t show some code, they will close your question

  • Okay, I’m new here, just paste the code here?

  • click edit and paste your code

  • Look I guess it didn’t work out so much just paste the code huh

  • hit your code

  • then, create a file cabecario.php and a file rodape.php that will be included in the page that will run the video

  • But when someone uploads I wanted to automatically create a page containing the video, as if it were a blog post.

  • 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

  • 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.

  • ai becomes very extensive and complicated explain through comments

  • But could you just tell me a programming language or something to research?

  • PHP is a good option

  • Thank you see if I find something

Show 12 more comments
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.