Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?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";
- else
- $msg = "Falha ao enviar.";
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement