Ver Mensaje Individual
  #13 (permalink)  
Antiguo 24/06/2011, 05:30
ZebaA
 
Fecha de Ingreso: junio-2011
Mensajes: 26
Antigüedad: 12 años, 11 meses
Puntos: 0
Respuesta: guardar imagenes con formulario

ok...

formulario registro_vehiculo.php

Código PHP:
Ver original
  1. <form method="post" name="formulario" action="insertar.php" enctype="multipart/form-data" >
  2. <table border="1" width="249">
  3.     <tr>
  4.         <td width="98">Nombre:</td>
  5.         <td width="135"><input type="text" name="nombre" size="20" /></td>
  6.     </tr>
  7.     <tr>
  8.         <td width="98">Apellidos:</td>
  9.         <td width="135"><input type="text" name="apellidos" size="20" /></td>
  10.     </tr>
  11.     <tr>
  12.         <td width="98">Telefono:</td>
  13.         <td width="135"><input type="text" name="fono" size="20" /></td>
  14.     </tr>
  15.     <tr>
  16.         <td width="98">Direccion:</td>
  17.         <td width="135"><input type="text" name="direccion" size="20" /></td>
  18.     </tr>
  19.     <tr>
  20.         <td width="98">Email:</td>
  21.         <td width="135"><input type="text" name="email" size="20" /></td>
  22.     </tr>
  23. </table>
  24. <div align="right"><strong class="Estilo1">(*)<span class="Estilo5"> - Campos Obligatorios</span></strong></div><br/>
  25. <table align="center" border="1" width="90%" bgcolor="#CCCCCC">
  26.         <tr>
  27.           <td width="105"><strong class="Estilo1">Vehiculo Nuevo</strong></td>
  28.           <td width="171">&nbsp;<select name="nuevo">
  29.                                     <option>Seleccione Una Opcion...</option>
  30.                                     <option value="no">NO</option>
  31.                                     <option value="si">SI</option>
  32.           </select></td>
  33.            <td width="105"><strong class="Estilo1">Tipo Vehiculo(*)</strong></td>
  34.           <td width="171">&nbsp;<?php include ('tipo_vehiculo.php');?></td>
  35.         </tr>
  36.         <tr>
  37.             <td width="105"><strong class="Estilo1">Carroceria(*)</strong></td>
  38.           <td width="171"><div id="resultado"></div></td>
  39.            
  40.             <td width="105"><strong class="Estilo1">Marca(*)</strong></td>
  41.           <td width="171">&nbsp;<input type="text" name="marca" /></td>
  42.         </tr>
  43.         <tr>
  44.             <td width="105"><strong class="Estilo1">Modelo(*)</strong></td>
  45.           <td width="171">&nbsp;<input type="text" name="modelo" /></td>
  46.            
  47.             <td width="105"><strong class="Estilo1">Año(*)</strong></td>
  48.           <td width="171">&nbsp;<input type="text" name="ano" size="8" /></td>
  49.         </tr>
  50.          <tr>
  51.             <td width="105"><strong class="Estilo1">Patente(*)</strong></td>
  52.            <td width="171">&nbsp;<input type="text" name="patente" size="8" maxlength="6" onBlur="this.value = RvalPat(this.value)"/></td>
  53.            
  54.             <td width="105"><strong class="Estilo1">Precio(*)</strong></td>
  55.            <td width="171">&nbsp;<input type="text" name="precio" maxlength="11" onBlur="this.value=retInt(this.value)"/></td>
  56.         </tr>
  57.         <tr>
  58.             <td width="105"><strong class="Estilo1">Descripcion(*)</strong></td>
  59.             <td width="171" align="center"><textarea name="otro" rows=4 cols=40 ></TEXTAREA></FONT></td>
  60.             <td width="105"><strong class="Estilo1">Radio</strong></td>
  61.             <td width="171" align="center"><input type="checkbox" name="radio" /></td>
  62.     </tr>
  63.         <tr>
  64.             <td width="105"><strong class="Estilo1">Imagen</strong></td>
  65.             <td width="171">&nbsp;<input name="foto" type="file" size="35" value="noimagen.jpg" />
  66.                                     <input name="action" type="hidden" value="upload" /></td>
  67.             <td width="105"><strong class="Estilo1">Alarma</strong></td>
  68.             <td width="171" align="center"><input type="checkbox" name="alarma"/></td>            
  69.         </tr>
  70. </table>
  71. <br />
  72. <br />
  73. <center>
  74. <input type="submit" value="Enviar" onclick="valida()">
  75. </center>
  76. </form>

y aka lo kiero mostrar... publicacion.php

Código PHP:
Ver original
  1. <?php
  2. include ('conexion.php');
  3.  
  4. $cod = $_GET['id'];
  5. $sql = mysql_query("SELECT * FROM datos_auto WHERE patente = '$cod'");
  6.  
  7. ?>
  8. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  9. <html xmlns="http://www.w3.org/1999/xhtml">
  10. <head>
  11. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  12. <title>Documento sin t&iacute;tulo</title>
  13. <style type="text/css">
  14. <!--
  15. .Estilo2 {font-size: 18px}
  16. .Estilo3 {font-size: 16px}
  17. .Estilo4 {font-size: 24px; font-family: Arial, Helvetica, sans-serif}
  18. -->
  19. </style>
  20. </head>
  21.  
  22. <body>
  23. <?php
  24. while($fila = mysql_fetch_array($sql))
  25.     {
  26. ?>
  27. <table align="center">
  28.     <tr bgcolor="#ffffff">
  29.       <td class="Estilo4" align="center"><?php echo $fila['marca'];?></td>
  30.     </tr>
  31.     </table><br /><br />
  32. <img src="imagenes/<?php echo $row['imgane']; ?>">
  33. <div align="center"><a href="registro_vehiculo.php?modo=1&amp;id=<?php echo $fila['id']?>">Modificar Publicacion</a>&nbsp;&nbsp; - &nbsp;&nbsp;<a href="#">Eliminar Publicacion</a></div>
  34.     <hr />
  35. <table align="center" width="950" height="59" border="1">
  36.     <tr>
  37.         <td width="300" bgcolor="#a4c2c2"><div align="center" class="Estilo2">Nuevo</div></td>
  38.         <td width="300" bgcolor="#a4c2c2"><div align="center" class="Estilo2">Tipo De Vehiculo</div></td>
  39.         <td width="300" bgcolor="#a4c2c2"><div align="center" class="Estilo2">Carroceria</div></td>
  40.         <td width="300" bgcolor="#a4c2c2"><div align="center" class="Estilo2">Modelo</div></td>
  41.         <td width="300" bgcolor="#a4c2c2"><div align="center" class="Estilo2">Marca</div></td>
  42.         <td width="300" bgcolor="#a4c2c2"><div align="center" class="Estilo2">A&ntilde;o</div></td>
  43.         <td width="300" bgcolor="#a4c2c2"><div align="center" class="Estilo2">Patente</div></td>
  44.         <td width="300" bgcolor="#a4c2c2"><div align="center" class="Estilo2">Regi&oacute;n</div></td>
  45.         <td width="300" bgcolor="#a4c2c2"><div align="center" class="Estilo2">Ciudad</div></td>
  46.         <td width="300" bgcolor="#a4c2c2"><div align="center" class="Estilo2">Precio</div></td>
  47.         <td width="300" bgcolor="#a4c2c2"><div align="center" class="Estilo2">Radio</div></td>
  48.         <td width="300" bgcolor="#a4c2c2"><div align="center" class="Estilo2">Alarma</div></td>
  49.     </tr>
  50.     <tr>
  51.         <td class="Estilo3"><div align="center"><?php echo $fila["nuevo"]?></div></td>
  52.         <td class="Estilo3"><div align="center"><?php echo $fila["tipo_vehi"]?></div></td>
  53.         <td class="Estilo3"><div align="center"><?php echo $fila["carroceria"]?></div></td>
  54.         <td class="Estilo3"><div align="center"><?php echo $fila["modelo"]?></div></td>
  55.         <td class="Estilo3"><div align="center"><?php echo $fila["marca"]?></div></td>
  56.         <td class="Estilo3"><div align="center"><?php echo $fila["ano"]?></div></td>
  57.         <td class="Estilo3"><div align="center"><?php echo $fila["patente"]?></div></td>
  58.         <td class="Estilo3"><div align="center"><?php echo $fila["region"]?></div></td>
  59.         <td class="Estilo3"><div align="center"><?php echo $fila["ciudad"]?></div></td>
  60.         <td class="Estilo3"><div align="center"><?php echo $fila["precio"]?></div></td>
  61.         <td class="Estilo3"><div align="center"><?php echo $fila["radio"]?></div></td>
  62.         <td class="Estilo3"><div align="center"><?php echo $fila["alarma"]?></div></td>
  63.     </tr>
  64. </table>
  65. </p>
  66. </p>
  67. <table align="center" width="950" height="40" border="1">
  68.     <tr>
  69.         <td width="300" bgcolor="#a4c2c2"><div align="center" class="Estilo2">Descripcion</div></td>
  70.     </tr>
  71.     <tr>
  72.         <td class="Estilo3"><div>&nbsp;&nbsp;<?php echo $fila["otro"]?></div></td>
  73.     </tr>
  74.         <?php
  75.             }
  76.         ?>
  77. </table>
  78. </body>
  79. </html>

ojo... el nombre del campo se llama imgane me vine a dar cuenta despues .....