Ver Mensaje Individual
  #12 (permalink)  
Antiguo 22/07/2003, 13:18
Avatar de biblio
biblio
 
Fecha de Ingreso: enero-2002
Ubicación: Urano
Mensajes: 577
Antigüedad: 22 años, 3 meses
Puntos: 0
Código PHP:
if (isset($_POST['Submit'])){
    
$update ="UPDATE tutable SET ";
    if(
$_FILES['file1']['size'] > 0){
        
$update.=" foto1 = file1 ";
    }
    if(
$_FILES['file2']['size'] > 0){
        
$update.="foto2 = file2 ";
    }
    
$update .="WHERE Id = '800' LIMIT 1 ;";

    echo 
$update;
}
?>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<form name="form1" enctype="multipart/form-data" method="post" action="prueba.php">
  <p> 
    <input name="file1" type="file" id="file1">
    <br>
    <input name="file2" type="file" id="file2">
    <br>
    <input type="submit" name="Submit" value="Submit">
  </p>
  </form>
</body>
</html> 
Está un poco arcaico, pero te dará una ayuda al menos. Eso de tener checkbox, no me cabe, porque el sistema debe reconocer automaticamente que campos actualizar.


Saludos

Última edición por biblio; 22/07/2003 a las 13:20