Ver Mensaje Individual
  #5 (permalink)  
Antiguo 19/03/2009, 12:17
majony
(Desactivado)
 
Fecha de Ingreso: diciembre-2008
Mensajes: 421
Antigüedad: 15 años, 4 meses
Puntos: 0
Respuesta: Problemas con update url

No se ahora lo que pasa hice esto

Código php:
Ver original
  1. <?php
  2. include('conectar.php');
  3.  $link = Conectarse();
  4. $result=mysql_query("Select * From archivos");
  5.    while ($row=mysql_fetch_array($result))
  6.      {
  7.      ?>
  8.  
  9.  
  10. <html>
  11. <head>
  12. <title></title>
  13. </head>
  14. <body>
  15. <form action="actualizar.php" method="post" enctype="multipart/form-data">
  16. <input name="id" type="hidden" value="<?php echo  $row['id']; }?> " />
  17.    
  18.     <table align="center" border="1">
  19.  
  20.    <tr>
  21.  
  22.      <td> Nombre:</td>
  23.      <td> <input name="nombre_archivo" type="text" size="30" maxlength="70" value="<?php echo $row['name'];?>"></td>
  24.    </tr>
  25.    <tr>
  26.      <td>Descripcion: </td>
  27.      <td><input name="description" type="text" size="30" maxlength="250" value="<?php echo $row['description']; ?>"></td>
  28.    </tr>
  29.      <tr>
  30.     <td> Archivo:</td>
  31.     <td> <input name="fichero" type="file" size="30" maxlength="150"></td>
  32.    </tr>
  33.     <tr>
  34.     <td colspan="2" align="center">
  35.     <input name="submit" type="submit" value="Guardar"><input type="reset" name="Cancelar" value="Cancelar">  </td>
  36. </form>
  37.   </tr>
  38.  
  39. </body>
  40. </html>

Y este es muy actualizar.php
Código php:
Ver original
  1. <HTML>
  2. <HEAD>
  3. <TITLE>Actualizar</TITLE>
  4. </HEAD>
  5. <BODY>
  6. <?
  7. include("conectar.php");
  8.  $link = Conectarse();
  9.  $id = intval($_POST['id']);
  10.  $nombre_archivo = $_POST['nombre_archivo'];
  11.  $description = $_POST['description'];
  12.  
  13.  
  14. //Creamos la sentencia SQL y la ejecutamos
  15.  
  16. mysql_query("Update archivos Set name='$nombre_archivo' , description='$description' ,$ruta='.$_FILES[fichero][name]',tipo='.$_FILES[fichero][type]',size='.$_FILES[fichero][size]' Where id='$id'");
  17. ?>
  18.  
  19. <h1><div align="center">Registro Actualizado</div></h1>
  20.  
  21.  
  22. </BODY>
  23. </HTML>
  24.  
  25. Me vota ahora si correctamente mi url [url]http://localhost/proyecto/descargas/editar.html.php?id=11[/url]
  26. Pero no me actualiza hice esto en mi listado.
  27.  
  28. [HIGHLIGHT="php"]
  29.  <?php     
  30.                
  31.               while($row = mysql_fetch_array($listado)){
  32.                printf("<tr>
  33.                        <td align=center>%s</td>
  34.                        <td>%s</td>
  35.                        <td>%s</td>
  36.                        <td align=center>%s</td>
  37.                        <td><a href=\"editar.html.php?id={$row['id']}\">actualizar</a></td>
  38.                        <td><a href=\"eliminar.html.php?id=$id\">Eliminar</a></td>
  39.                        </tr>",$row["id"],$row["name"],$row["description"],$row["size"]);
  40.    }
[/HIGHLIGHT]