Ver Mensaje Individual
  #2 (permalink)  
Antiguo 06/02/2010, 10:24
maceguo
 
Fecha de Ingreso: febrero-2010
Mensajes: 2
Antigüedad: 14 años, 3 meses
Puntos: 0
Respuesta: Ayuda!! Problemas con PHP y MySQL

Me falto un pedazo! jeje

Es la pagina del la opcion Agregar del Menu:

Código:
</html><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>


<style type="text/css">
<!--
.Estilo3 {font-size: xx-small}
-->
</style>
</head>
<body>
<p><em>Si desea cargar una nueva operacion, complete correctamente todos los campos. Gracias.</em></p>

<form  method="post" action="database.php?formulario=1"> 

	<div align="center">
			<input type="hidden" name="formulario" id="formulario" value="1" />
    </div>
  <table width="750" border="0" align="left" cellpadding="0" cellspacing="0" style="background-color:#FFFFCC">
  <tr>
      <th width="118" height="20" class="Estilo23" scope="col"><div align="right"><strong>Operacion:</strong></div></th>
      <th align="left" width="165" height="20" class="Estilo23" scope="col"><label><select name="operacion" id="operacion">
          <option selected>Seleccione</option>
          <option>Venta</option>
          <option>Alquiler</option>
          <option>Permuta</option>
          <option>Fondo de Comercio</option>
        </select>
      </label></th>
      <th width="189" height="20" scope="col"><div align="right"><strong>Patio/Jardin:</strong></div></th>
      <th width="228" height="20" scope="col"><div align="left"><input name="jardin" type="checkbox" id="jardin" value="checkboxjardin" />
      </div>
      </label></th>
    </tr>
    <tr>
      <th width="118" height="20" class="Estilo23" scope="row"><div align="right">Inmuebles:</div></th>
      <td width="165" height="20" class="Estilo23"><label>
        <select name="inmueble" id="inmueble">
          <option selected>Seleccione</option>
          <option>Departamento</option>
          <option>Casa</option>
          <option>Quinta</option>
          <option>Terreno y lote</option>
          <option>Oficina</option>
          <option>Cochera</option>
          <option>Campo</option>
          <option>Galpón</option>
          <option>Hotel</option>
          <option>Fondo de Comercio</option>
          <option>Local comercial</option>
          <option>Edificio, Deposito</option>
        </select>
      </label></td>
      <td height="20"><div align="right"><strong>Cochera:</strong></div></td>
      <td height="20"><label>
        <input name="cochera" type="checkbox" id="cochera" value="checkboxcochera" />
      </label></td>
    </tr>
    <tr>
      <th height="20" class="Estilo23" scope="row"><div align="right"><strong>Ambientes:</strong></div></th>
      <td height="20" class="Estilo23"><label>
        <select name="ambiente" id="ambiente">
          <option selected>Seleccione</option>
          <option>1</option>
          <option>2</option>
          <option>3</option>
          <option>4</option>
          <option>5</option>
		  <option>6</option>
		  <option>7</option>
          <option>8 o +</option>
        </select> </label></td>
      <td height="20"><div align="right"><strong>Terraza:</strong></div></td>
      <td height="20"><label>
        <input name="terraza" type="checkbox" id="terraza" value="checkboxterraza" />
      </label></td>
    <tr>
      <th height="20" scope="row"><div align="right">Superficie m2: </div></th>
      <td height="20"><label>
        <input name="superficie" type="text" id="superficie" value="0" maxlength="8" />
      </label></td>
      <td height="20"><div align="right"><strong>Pileta:</strong></div></td>
      <td height="20"><label>
        <input name="pileta" type="checkbox" id="pileta" value="checkboxpileta" />
        </label></td>
    </tr>
    <tr>
      <td width="118" height="20" class="Estilo23">&nbsp;</td>
      <td width="165" height="20" valign="bottom">&nbsp;</td>
      <td height="20"><div align="right"><strong>Banios:</strong></div></td>
      <td height="20"><label>
        <select name="baño" id="baño">
          <option selected="selected">Seleccione</option>
          <option>1</option>
          <option>2</option>
          <option>3</option>
          <option>4</option>
          <option>5</option>
          <option>6</option>
          <option>7</option>
          <option>8 o +</option>
        </select>
      </label></td>
    </tr>
    <tr>
      <td width="118" height="20" class="Estilo23">&nbsp;</td>
      <td width="165" height="20" valign="bottom">&nbsp;</td>
      <td height="20"><div align="right"><strong>Cocina:</strong></div></td>
      <td height="20"><label>
        <select name="cocina" id="cocina">
          <option selected="selected">Seleccione</option>
          <option>1</option>
          <option>2</option>
          <option>3</option>
          <option>4</option>
          <option>5</option>
          <option>6</option>
          <option>7</option>
          <option>8 o +</option>
        </select>
      </label></td>
    </tr>
    <tr>
      <th width="118" height="20" class="Estilo23" scope="col"><div align="right"><strong>Provincia:</strong></div></th>
      <th width="165" height="20" valign="bottom" scope="col"><div align="left">
        <select name="provincia" id="provincia">
          <option>Buenos Aires</option>
          <br />
          </select>
      </div></th>
      <td height="20">&nbsp;</td>
      <td height="20">&nbsp;</td>
    </tr>
    <tr>
      <td width="118" height="20" class="Estilo23"><div align="right"><strong>Localidad:</strong></div></td>
      <td width="165" height="20" valign="bottom"><label>
        <select name="localidad" id="localidad">
          <option>-------------------------</option>
          <option>Capital Federal</option>
          <option>San isidro</option>
          <option>San Miguel</option>
          <option>Tigre</option>
        </select>
      </label></td>
      <td height="20">&nbsp;</td>
      <td height="20">&nbsp;</td>
    </tr>
    <tr>
      <td width="118" height="20" class="Estilo23"><div align="right"><strong>Área/Barrio:</strong></div></td>
      <td width="165" height="20" valign="bottom"><div align="left">
        <select name="barrio" id="barrio">
            <option>-------------------------</option>
            <option>Don Torcuato</option>
            <option>Pacheco</option>
          </select>
      </div></td>
      <td colspan="2" rowspan="3"><div align="left"><strong>Descripcion:</strong></div>
      <label>
      <textarea name="textarea" id="textarea" cols="50" rows="5"></textarea>
      </label></td>
    </tr>
    <tr>
      <th height="20" scope="row"><div align="right">Dirección: </div></th>
      <td height="20"><label>
        <input name="direccion" type="text" id="direccion" maxlength="20" />
      </label></td>
    </tr>
    <tr>
      <th height="20" scope="row"><div align="right">Precio en U$S: </div></th>
      <td height="20"><label>
        <input name="precio" type="text" id="precio" value="0" maxlength="8" />
      </label></td>
    </tr>
    <tr>
      <th height="50" scope="row">&nbsp;</th>
      <td height="50"><input name="load" type="submit" id="load" value="Cargar" /> <label>
        <input name="reset" type="reset" id="reset" value="Restablecer" />
      </label></td>
      <td height="50">&nbsp;</td>
      <td height="50">&nbsp;</td>
    </tr>
  </table>
</form>
<br /> 
<br /> <br /> <br /> <br /> <br /> <br /> <br /> <br />
<br /> <br /> <br /> <br /> <br /> <br /> <br /> <br />
<br />
<form>
  <p>
    <?php

//Conectamos con la base de datos "basededatos"
mysql_connect('localhost','user','clave'); // usuario 
mysql_select_db('basedatos'); //Base De Datos

if(($_GET["formulario"]=="1") && (!empty($_REQUEST["textarea"]))) {

$operacion = $_POST["operacion"];
$inmueble = $_POST["inmueble"];
$superficie= $_POST["superficie"];
$provincia= $_POST["provincia"];
$localidad= $_POST["localidad"];
$barrio= $_POST["barrio"];
$direccion= $_POST["direccion"];
$jardin= $_POST["jardin"];
$cochera= $_POST["cochera"];
$terraza= $_POST["terraza"];
$pileta= $_POST["pileta"];
$banios= $_POST["banios"];
$cocina= $_POST["cocina"];
$descripcion= $_POST["descripcion"];
$precio = $_POST["precio"];

mysql_query ("INSERT INTO inmobiliaria (operacion, inmueble, ambientes, superficie,descripcion, precio)
VALUES ('$operacion', '$inmueble', $ambientes', '$superficie', '$descripcion', 'precio')"); 
//solo coloco algunas variables para probar

?>
<script type="text/javascript">document.location.href='adm.php?formlogin=1'</script>
<?php

}
?>

  </tr>
	</table>
</form>

<?php

//Cierra la conexion con la base de datos
mysql_close();

?>

</body>
</html>
Saludos,
Marcos