By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,962 Members | 2,545 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,962 IT Pros & Developers. It's quick & easy.

Errors uploading files, files won't upload

P: 1
Expand|Select|Wrap|Line Numbers
  1. <?
  2. $instituto=$_POST['instituto'];
  3.  $carrera=$_POST['carrera'];
  4.  $materia=$_POST['materia'];
  5.  $titulo=$_POST['titulo'];
  6.  $paginas=$_POST['paginas'];
  7.  
  8.  $formato=".pdf";
  9.  $direccion=$instituto."/".$carrera."/".$materia."/".$titulo.$formato;
  10.      if(isset($_FILES['documento']) && $_FILES['documento']['type']=='application/pdf'){
  11.         move_uploaded_file ($_FILES['documento']['tmp_name'] ,$direccion );
  12.         header('Location:adminfinal.php');}
  13.  
  14.  
  15. $base= new PDO('mysql:host=localhost; dbname=prueba','root','');
  16. $base->exec("set character set utf8");
  17. $sql="INSERT INTO id_libro (instituto,carrera,materia,titulo,paginas,direccion) VALUES (:ins,:ca,:ma,:ti,:pa,:di)";
  18. $resultado=$base->prepare($sql);
  19. $resultado->execute(array(":ins"=>$instituto,":ca"=>$carrera,":ma"=>$materia,":ti"=>$titulo,":pa"=>$paginas,":di"=>$direccion));
  20. ?>```
  21.  
1 Week Ago #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.