Guest User

Untitled

a guest
May 20th, 2018
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. <?php
  2. include('config/conexao.php');
  3.  
  4. $evento=$_POST["evento"];
  5. $id_album = $_POST["id_album"];
  6. $dia=$_POST["dia"];
  7. $mes=$_POST["mes"];
  8. $comentario=$_POST["comentario"];
  9. $ano=$_POST["ano"];
  10. $data=$ano.$mes.$dia;
  11. $data_cad=date('Y-m-d');
  12. $data_alt=date('Y-m-d');
  13. $ip=getenv("REMOTE_ADDR");
  14. $status = "Sim";
  15. $i = $_FILES["arquivo"];
  16.  
  17.  
  18.  
  19. if($i == "" ){ echo "nao deu";}
  20. else{
  21. $arquivo = $_FILES["arquivo"];
  22. $pasta_dir = "img/";
  23.  
  24. $arquivo_nome = $pasta_dir . $arquivo["name"];
  25.  
  26. move_uploaded_file($arquivo["tmp_name"], $arquivo_nome);
  27.  
  28.  
  29.  
  30. mysql_query("INSERT INTO fotos VALUES ('','$id_album','$evento','$comentario','$arquivo_nome','$data','$data_cad','$data_alt','$ip','$status')");
  31.  
  32. echo "Cadastrado";
  33. }
  34.  
  35. ?>
Add Comment
Please, Sign In to add comment