Ver Mensaje Individual
  #1 (permalink)  
Antiguo 18/11/2009, 18:34
marcos46g
 
Fecha de Ingreso: julio-2009
Mensajes: 311
Antigüedad: 14 años, 9 meses
Puntos: 0
Pregunta formulario envia accion al mismo formulario

El usuario selecciona las opciones que le sirvan y envia el formulario
Los resultados quiero que se muestren en el mismo formulario
Pero no logro ni cargar los valores de las varialbes y menos mostrar los registros
que resultarian de la consulta sql

A ver si me das una manito...
Gracias desde ya

<?php

if (!isset($_POST['Submit'])) {
?>

<td width="557" height="103" bgcolor="#0066CC"><form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="POST" name="form1" id="form1" style="font-weight: bold; color: #333333">

<div align="right">
<p align="center" style="color: #FFFFFF"><span style="font-weight: bold; font-size: 18px; font-family: &quot;Times New Roman&quot;, Times, serif">Buscador de propiedades </span></p>
<p align="center"><span class="Estilo5">
<select name="tpropiedad" id="select">
<option>Casa</option>
t

<option>Apartamento</option>
<option>Local Comercial</option>
<option>Garage</option>
<option>Chacra </option>
<option>Terreno</option>
<option>Oficina</option>
</select>
</span>
<span class="Estilo5"> &nbsp;&nbsp;
<select name="toperacion" id="label">
<option selected="selected">Venta</option>
<option>Alquiler permanente</option>
<option>Alquiler por temporada</option>
<option>Permuta</option>
<option>Venta o Permuta</option>
<option>Alquiler o Venta</option>
</select>
&nbsp;&nbsp; </span>
<input type="button" name="Submit" value="ver resultados" />
</p>
<p>&nbsp; </p>
</div>
</form> </td>
</tr>
</table>
<p>
<table width="800" >
<tr>
<th width="50" scope="col"></th>
<th width="50" scope="col"></th>
<th width="700" scope="col"></th>

</tr>

<?php
}else{
$tpropiedad = $_POST['tpropiedad'];// si hago un echo estos valores no continen nada aun que se hallan seleccionado en el formulario
$toperacion = $_POST['toperacion'];

print "<meta http-equiv=Refresh content=\"0 ; url=pg3.php\">";
}
?>

<?
include 'db.php';

$consultaSQL="SELECT * FROM avisos WHERE tpropiedad='".$tpropiedad."' && toperacion='".$toperacion."'";
$result=mysql_query($consultaSQL);
while ($row=mysql_fetch_array($result)) {
echo '<tr><td>/</td>';
echo '<td><font color="blue"><font size="3"><align="right">'.$row["idAviso"].'</td>';
echo '<td ><font color="blue"><font size="3"><align="left">'.$row["txt"].'</td></tr>';

}
?></