Ver Mensaje Individual
  #3 (permalink)  
Antiguo 17/06/2003, 10:13
Avatar de camargo
camargo
 
Fecha de Ingreso: abril-2002
Ubicación: Kerétaro, Méjiko
Mensajes: 1.045
Antigüedad: 22 años, 1 mes
Puntos: 2
ferent el lo q quiere decir es insertar la imagen en la BD MYSQL, y es muy sencillo:

Formulario:
Código:
<form method=post action=enviar.php>
<input type=file name=form_data><br>
<input type=submit value=enviar></form>
enviar.php

Código PHP:
//CONEXION BD MYSQL

$data addslashes(fread(fopen($form_data"r"), filesize($form_data)));

mysql_query("INSERT INTO tabla (imagen,filetype)
 VALUES ('$imagen','$form_data_type')"
); 
imagen.php
Código PHP:
if($id) {
//CONEXION BD MYSQL

    
$hazquery "select imagen,filetype from TABLA where id LIKE '$id'";
    
$resultexe = @MYSQL_QUERY($hazquery);

    
$data = @MYSQL_RESULT($resultexe,0,"imagen");
    
$type = @MYSQL_RESULT($resultexe,0,"filetype");

    
Header"Content-type: $type");
    echo 
$data;

}; 
ver_imagenes_por_usuario.php

Código PHP:
//conexion bd mysql
//mysql query a la tabla

while($row=mysql_fetch_array($query)){
echo 
"
<img src=\"imagen.php?id="
.$row[id]."\" border=0>";

La tabla debe contener un campo [id] auto_increment, primaria, etc..

y listo;) c/usuario puede asi subir su foto
Salu2
__________________
http://www.chorcha.com