Ir al contenido


Foto

upload multiples de imagenes


  • Por favor identifícate para responder
No hay respuestas en este tema

#1 ricardo777

ricardo777

    Newbie

  • Miembros
  • Pip
  • 7 mensajes

Escrito 23 mayo 2014 - 12:41

que tal gente un favor tengo este codigo


delphi
  1. <?php
  2. session_start();
  3. require_once("conexion/Coneccion.php");
  4. if(empty($_FILES["foto"]["name"])and empty($_FILES["foto2"]["name"])and empty($_FILES["foto3"]["name"]))
  5.         {
  6.             $image1=$_POST["image1"];
  7. $image2=$_POST["image2"];
  8. $image3=$_POST["image3"];
  9.          
  10.           $sql="update descripcion set idc='".$_POST["idc"]."',texto1='".$_POST["texto"]."',fecha1='".Coneccion::invierte_fecha($_POST["fecha1"],2)."',texto2='".$_POST["texto2"]."',fecha2='".Coneccion::invierte_fecha($_POST["fecha2"],2)."',texto3='".$_POST["texto3"]."',fecha3='".Coneccion::invierte_fecha($_POST["fecha3"],2)."',texto4='".$_POST["texto4"]."',fecha4='".Coneccion::invierte_fecha($_POST["fecha4"],2)."',fechas='".$_POST["datehost"]."',usuario='".$_SESSION['admin']."' where idd=".$_POST["idd"]." ";
  11. $res=@mysql_query($sql,Coneccion::con());
  12. header("Location: consultahomeid.php?m=1");
  13.         }else
  14. {
  15. /*FOTO1*/
  16. $foto=$_FILES["foto"]["name"];
  17. $temp=$_FILES["foto"]["tmp_name"];
  18. $tamano=$_FILES["foto"]["size"];
  19. $tipo=$_FILES["foto"]["type"];
  20. /*foto2*/
  21. $foto2=$_FILES["foto2"]["name"];
  22. $temp2=$_FILES["foto2"]["tmp_name"];
  23. $tamano2=$_FILES["foto2"]["size"];
  24. $tipo2=$_FILES["foto2"]["type"];
  25.  
  26.  
  27. /*foto3*/
  28. $foto3=$_FILES["foto3"]["name"];
  29. $temp3=$_FILES["foto3"]["tmp_name"];
  30. $tamano3=$_FILES["foto3"]["size"];
  31. $tipo3=$_FILES["foto3"]["type"];
  32. //echo"1".$foto1."2".$foto2."3".$foto3;
  33. //print_r($_POST);
  34. //print_r($_FILES);
  35. $nombre_foto=$foto;
  36. $nombre_foto2=$foto2;
  37. $nombre_foto3=$foto3;
  38. copy($temp,"upload/$nombre_foto");
  39. copy($temp2,"upload/$nombre_foto2");
  40. copy($temp3,"upload/$nombre_foto3");
  41.  
  42. }
  43. //Ahora guardamos el archivo en una tabla de la base  LA FOTO
  44.  
  45. $sql="update descripcion set idc='".$_POST["idc"]."',texto1='".$_POST["texto"]."',fecha1='".Coneccion::invierte_fecha($_POST["fecha1"],2)."',texto2='".$_POST["texto2"]."',fecha2='".Coneccion::invierte_fecha($_POST["fecha2"],2)."',texto3='".$_POST["texto3"]."',fecha3='".Coneccion::invierte_fecha($_POST["fecha3"],2)."',texto4='".$_POST["texto4"]."',fecha4='".Coneccion::invierte_fecha($_POST["fecha4"],2)."',imagen1='$nombre_foto',imagen2='$nombre_foto2',imagen3='$nombre_foto3',fechas='".$_POST["datehost"]."',usuario='".$_SESSION['admin']."' where idd=".$_POST["idd"]." ";
  46. $res=@mysql_query($sql,Coneccion::con());
  47. header("Location: consultahomeid.php?m=1");
  48.  
  49. //header("Location: consultahomeid.php?m=2");
  50.  
  51.  
  52.  
  53. ?>


pero no me actualiza las imagenes solo el texto ayudenme porfavor ojo que envio los datos via hidden


  • 0




IP.Board spam blocked by CleanTalk.