PHP - visualizar + datos de imagen al dar click

 
Vista:
sin imagen de perfil

visualizar + datos de imagen al dar click

Publicado por julian (16 intervenciones) el 14/05/2013 01:17:43
hola lo q quiero hacer es q me liste un resultado , esto ya blo tengo echo y q en la foto de cada uno me muestre unos campos como los q tengo aca http://imageshack.us/photo/my-images/600/imagenk.png/, pero me gustaria hacer click en la foto y q me lleve a mas datos y me los ordene bien en tablas y eso ,me gustaria agregar descripcion,dormitorios, ubicacion este es una foto
y nose como hacerlo . aca tengo como muestro los resultados obtenidos

cargar-campo.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><script>function cargarModo(){
	modo=formCli.txtmodo.value;
	validoForm();
}
 
function validoForm(){
	if (validoCamposOblig()== 1 ){
	        alert ("Publiacion finalizada con exito");
		document.formCli.submit();
	}else{
 
	}
}
//aca agrego los campos q estan en el formulario q no pueden ser vacios , son iguales a como los llame en el formulario
function validoCamposOblig(){
   formCli = document.getElementById('formCli');
   if (formCli.titulo.value == "" ){
      alert ("Ingrese el titulo");
   }
   //para agregar un nuevo campo de validacion pego la parte de un if y lo cierro abajo todo esto antes del return 0 
      if (formCli.area.value == ""){
         alert ("Ingrese area ");
 
         return 0;
      } else {
         return 1;
      }
   }
   </script>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Documento sin título</title>
</head>
<body>
<form name="formCli" id="formCli" method="post" action="recibir.php"enctype="multipart/form-data">
 
  <p>Seleccione la Imagen:
    <input type="file" name="imagen"/>
  </p>
 
	Titulo
	<input type="text" name="titulo" id="titulo" /><BR>
  <p>Area:
    <input type="text" name="area" id="area" />
    <BR>
  <tr>
    <td colspan="3"><label>
	  <div align="left">
	    <input type="button" value="Enviar" onClick="cargarModo()" >
	    <input type="hidden" size="2" name="txtmodo" value="">
 
        </div>
    </label></td>
  </p>
  <p>&nbsp;</p>
</form>
</body>
</html>


mostrar.php

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php
$conexion=mysql_connect('localhost','root','root') or die('No hay conexión a la base de datos');
$db=mysql_select_db('rural',$conexion)or die('no existe la base de datos.');
 
$consulta=mysql_query("select * from campos");
while($filas=mysql_fetch_array($consulta)){
	$ruta=$filas['ruta'];
	$titulo=$filas['titulo'];
	$area=$filas['area'];
 
 
?>
 
<table border=1>
	<tr>
		<td><b>Titulo</b></td>
		<td><?php echo $titulo;?><br></td>
	</tr>
	<tr>
		<td><b>Area</b></td>
		<td><?php echo  $area;?><br></td>
	</tr>
	<tr>
		<td><b>Imagen</b></td>
		<td>
		<img src="<?php echo $ruta; ?>" width="180" height="214"><br>
 
		</td>
	</tr>
</table>
<p>
</body>
</html>
 
<?php }?>
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder