Ver Mensaje Individual
  #1 (permalink)  
Antiguo 14/03/2011, 14:50
jrrm
 
Fecha de Ingreso: agosto-2008
Mensajes: 108
Antigüedad: 15 años, 8 meses
Puntos: 0
Enviar archivos

tengo el siguiente codigo
Código:
$(document).ready(function(){
$('#boton').click(function(){
 event.preventDefault();
    			$.ajax({
			    		type: "POST",
					    url: "uploadimg.php",
					beforeSend:function(){$("#upload").hide().fadeIn("slow");},
						error:$("#error").hide().fadeIn("slow"),
						data: "img="+document.getElementById('img').value,
				   success: function(datos){
       							if (datos==1)
									{
										alert("si")
									}
									else		
									{
										
										$("#upload").css({'display':'none'});
										//$("#success").css({'display':'none'});
										//$("#upload").css({'display':'none'});
									}
				      			}
        					}); //fin ajax
		
						});
					});
y este para subir las imagenes
Código:
function generar($Paswd_Length){  
$lower_ascii_bound = 50;  
$upper_ascii_bound = 122;  

$notuse = array (58,59,60,61,62,63,64,73,79,91,92,93,94,95,96,108, 111);  
$i = 0;  
$password = '';  
while ($i < $Paswd_Length){  
mt_srand((double)microtime() * 1000000);  

$randnum = mt_rand($lower_ascii_bound, $upper_ascii_bound);  
if (!in_array($randnum, $notuse)){  
$password = $password.chr($randnum);  
$i++;  
};  
};  
return $password;  
} ;

$uploaddir = 'upload/';
$uploadfile = $uploaddir . generar(15) . basename($_FILES['img']['name']);

if (move_uploaded_file($_FILES['img']['tmp_name'], $uploadfile)) {
  echo "success";
} else {
  echo "error";
}
el detalle esta en que no me sube las imagenes...
Alguien que me pueda ayudar?