![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
25/07/2011, 15:19
|
| | Fecha de Ingreso: mayo-2011
Mensajes: 22
Antigüedad: 13 años, 9 meses Puntos: 0 | |
Respuesta: Guardar Imagen de Formulario y luego Mostrarla hermano guiame un poco tengo esto:
<form name="fvalida" method="POST" action="registro2.php" enctype="multipart/form-data">
<table width="90%" border="1" align="center">
<td align="center" ><font size="6" face="forte">Registro del Empleado </font></td>
</tr>
<tr>
<td class="panelr"><font color="white" size="4" face="forte">Información Personal </font></td>
</tr>
<tr>
<td bgcolor="#CCCCCC">
Nombre: <input type="text" name="nomb" size="20" />
</td>
</tr>
<tr>
<td> Primer Apellido: <input type="text" name="ape1" size="20"/>
Segundo Apellido: <input type="text" name="ape2" size="20"/></td>
</tr>
<tr>
<td bgcolor="#CCCCCC">CI:<input type="text" name="ci" size="9" maxlength="9" /></td>
</tr>
<tr>
<td height="27" bgcolor="#CCCCCC">Edad: <input type="text" name="ed" size="5"/ >
</td>
</tr>
<td>Sexo:
<input type="radio" name="sexo" value="M" checked> Masculino
<input type="radio" name="sexo" value="F" > Femenino
</td> AHORA ME IMAGINO Q HAGO ESTO:
<TR>
<TD>
<select name="icono" id="icono" >
<option value="0">Elige..</option>
<?php
$ruta = "tu_carpeta/"; // Indicar ruta
$filehandle = opendir($ruta); // Abrir archivos
while ($file = readdir($filehandle)) {
if ($file != "." && $file != "..") {
$tamanyo = GetImageSize($ruta . $file);
echo "<option value='$ruta$file'>$file</option>";
}
}
closedir($filehandle); // Fin lectura archivos
?>
</select>
</TD>
</TR>
<INPUT TYPE="SUBMIT" VALUE="GUARDAR">
Y EN REGISTRO.PHP
include ("conexion.php");
$nombre=$_POST['nomb'];
$RUTA=$_POST['ruta']
ETC...........
AQUI inserto!!
luego en MOSTRAR.PHP
QUIERO QUE AQUI ME MUESTRE LA FOTO!!
2 PREGUNTAS!!
1) cual varible es la que voy a guardar e mi base de datos $ruta como lo puse o que??
2) y como hago para que me muestre la foto en BUSQUEDA.PHP y no en el registro!!..
YO MUESTRO LOS RESULTADOS D ESTA FORMA EN BUSQUEDA.PHP
<?php
include("conexion.php");
$ci=$_POST['ci'];
if ($ci==null){
header("Location:index.php");
}
else{
$query=("SELECT nombre,apellido1,apellido2,ci,fndias,fnmes,fnano,e dad,sexo,tlf,direccion,correo,unidad,ubica,estatus ,cargo,gradoinst1,gradoinst2,fidias,fimes,fiano,cu rsosr,cursosp,actas1,actas2,per1,per2,per3,per4,pe r5,per6,per7
FROM personal WHERE ci = '$ci'");
$consulta=mysql_query($query);
if($result = mysql_fetch_assoc($consulta))
{
?>
<TABLE.....>
<tr>
<td class="panelr"><font color="white" size="4" face="forte">Información Personal </font></td>
</tr>
<tr>
<td bgcolor="#CCCCCC">
Nombre: <input type="text" name="nomb" size="20" disabled=true value="<?php echo $result['nombre']; ?>" />
</td>
</tr>
<tr>
<td> Primer Apellido: <input type="text" name="ape1" size="20" disabled=true value="<?php echo $result['apellido1
ASIII ETC... |