Ver Mensaje Individual
  #1 (permalink)  
Antiguo 12/04/2012, 18:45
c561283
 
Fecha de Ingreso: abril-2012
Mensajes: 3
Antigüedad: 12 años
Puntos: 0
Como evito carge la pagina a la php y borren datos de formulario al elegir un select

<?php
mysql_connect("localhost","vendoyre_usersis","mfsd a2555");
mysql_select_db("vendoyre_inmobiliaria");
$re=mysql_query("select * from ciudad");
//el @ sirve para que no salga ese mensaje de NOTICE al momento de ejecutar por 1ra ve nuestro codigo.
if(isset($_POST['ciudad'])){
$ciudad=$_POST['ciudad'];
$re1=mysql_query("select * from colonia where cod_ciudad=".$ciudad."");
$re2=mysql_query("select nombre from ciudad where cod_ciudad=".$ciudad."");
$j=mysql_fetch_array($re2);
}else{
@$j[nombre]='seleccione ciudad'; }
?>


<form id="form1" name="form1" method="post" action="registropropiedad.php">
Nombre completo
<input name="nombre" type="text" id="nombre" value="<?php echo @$_POST[nombre]?>" />
<br>
Rango de Precio:
<select name="idrangodeprecios" id="idrangodeprecios">
<option value="1">$150,000 - $249,000</option>
<option value="2">$250,000 - $349,000</option>
<option value="3">$350,000 - $449,000</option>
<option value="4">$450,000 - $549,000</option>
<option value="5">$550,000 - $649,000</option>
<option value="6">$650,000 - $749,000</option>
<option value="7">$750,000 - $849,000</option>
<option value="8">$850,000 - $999,000</option>
<option value="9">$1,000,000 - $1,249,000</option>
<option value="10">$1,250,000 - $1,449,000</option>
<option value="11">$1,500,000 - $2,000,000</option>
<option value="12">$2,500,000 - $3,000,000</option>
<option value="13">$3,000,000+</option>
</select><br>
T&iacute;tulo:<font size="-2">(Casa, Local, Bodega)</font>
<input name="titulo" type="text" id="titulo" value="<?php echo @$_POST[titulo]?>"><br>

Mts<font size="-2">2.</font> Const y Terr:&nbsp;&nbsp;&nbsp;
<input name="mtscuadrados" type="text" id="mtscuadrados" value="<?php echo @$_POST[mtscuadrados]?>"><br>

Ba&ntilde;os:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input name="banos" type="text" id="banos" value="<?php echo @$_POST[banos]?>"><br>

Habitaciones:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input name="habitaciones" type="text" id="habitaciones" value="<?php echo @$_POST[habitaciones]?>" ><br>

Precio de Venta:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input name="precioventa" type="text" id="precioventa" value="<?php echo @$_POST[precioventa]?>"><br>

Precio de Renta:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input name="preciorenta" type="text" id="preciorenta" value="<?php echo @$_POST[preciorenta]?>" ><br>

Tipo de Inmueble:&nbsp;&nbsp;&nbsp;
<input name="tipoinmueble" type="text" id="tipoinmueble" value="<?php echo @$_POST[tipoinmueble]?>" size="3" maxlength="1">
<font size="-2">1=venta, 2=renta, 3=ambas opciones</font></span><br>
Descripcion:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input name="descripcion" type="text" id="descripcion" value="<?php echo @$_POST[descripcion]?>" maxlength="240"><br>

Fecha: <font size="-2">[aaaa-mm-dd]</font>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input name="fechaingreso" type="text" id="fechaingreso" size="20" value="<?php echo @$_POST[fechaingreso]?>" maxlength="10" ><br>

<select name="ciudad" size="1" id="ciudad" onChange="form1.submit()" style="width:200px">
<option value="0" selected="selected"><?php echo @$j[nombre];?></option>

<?php
session_start();
$_SESSION[retornar] = $_SERVER['PHP_SELF'] ;
?>

<?php

while($f=mysql_fetch_array($re)){
echo'<option value='.$f[cod_ciudad].'>'.$f[nombre].'</option>';

}
?>
</select>
<br />

<select name="colonia" size="1" id="colonia" style="width:200px">
<?php
while($f1=mysql_fetch_array($re1)){

echo'<option>'.$f1[nombre].'</option>';
}
?>
</select>

</p>

<input type="hidden" value="Registrar Propiedad" id="evento_nuevo" name="pageOperation" />
<input type="submit" value="Registrar Propiedad" id="evento_nuevo" name="evento_nuevo" />
</form>




<font size="2" color="#FF0000"><b>Nota.- Es indispensable no dejar ningun campo vacio, cuando no corresponda alguno favor de poner<br> la palabra NO para que pueda registrar con exito su propiedad, Gracias por su preferencia y confianza.</b></font>