Ver Mensaje Individual
  #12 (permalink)  
Antiguo 18/01/2010, 11:43
krewer
 
Fecha de Ingreso: enero-2010
Mensajes: 33
Antigüedad: 14 años, 4 meses
Puntos: 0
Respuesta: como inserto el avatar a un usuario registrado en php

muchas gracias, me sirvio harto el codigo que me dieron, pero ahora tengo el siguiente problema, ajuste el codigo y todo pero cuando subo la imagen me sale lo siguiente

Cita:
Warning: move_uploaded_file(./upload/122605-P1220011.JPG) [function.move-uploaded-file]: failed to open stream: No such file or directory in C:\AppServ\www\Dathporth\Data\images\subir.php on line 8

Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move 'C:\WINDOWS\Temp\php18F.tmp' to './upload/122605-P1220011.JPG' in C:\AppServ\www\Dathporth\Data\images\subir.php on line 8

Warning: chmod() [function.chmod]: No such file or directory in C:\AppServ\www\Dathporth\Data\images\subir.php on line 12
reviso el mysql y me registra la url pero sin la imgen registrada
aqui esta lo que sale

Cita:
http://localhost/Dathporth/upload/103389-
y aqui les dejo el codigo para que vean si hay algun error

Código PHP:
Ver original
  1. <?php
  2.    include ("../config.php");
  3.       $aleatorio=rand(81,150400);
  4.    
  5.          $uploadDir = './upload/'.$aleatorio.'-';
  6.              $uploadFile = $uploadDir . $_FILES['archivo']['name'];
  7.    
  8.           move_uploaded_file($_FILES['archivo']['tmp_name'], $uploadFile);
  9.    
  10.        
  11.    
  12.       chmod("upload/".$aleatorio."-".$_FILES['avatar']['name'], 777);
  13.  
  14.       $ruta="http://localhost/Dathporth/upload/".$aleatorio."-".$_FILES['avatar']['name'];
  15.      
  16.     $SQL= "UPDATE users SET avatar='ruta' WHERE nick='$_SESSION[usuario]'";
  17.    
  18.     mysql_query($SQL);
  19. ?>

Última edición por krewer; 18/01/2010 a las 11:49