1.php
Código PHP:
<?
session_start();
?>
Código HTML:
<html>
<head>
<title>Documento sin título</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<?
if($_GET['status']==1){
?>
<form name="alta_inmobiliaria" method="POST" action="2.php">
<p>nombre_empresa
<input type="text" name="nombre_empresa">
<br>
direccion
<input type="text" name="direccion">
<br>
cif_inmobiliaria
<input type="text" name="cif_inmobiliaria">
<br>
pais
<input type="text" name="pais">
<br>
provincia
<input type="text" name="provincia">
<br>
localidad
<input type="text" name="localidad">
<br>
codigo_postal
<input type="text" name="codigo_postal">
<br>
telefono
<input type="text" name="telefono">
<br>
fax
<input type="text" name="fax">
<br>
email
<input type="text" name="email">
<br>
login
<input type="text" name="login">
<br>
password
<input type="text" name="password">
<br>
confirmpass
<input type="text" name="confirmpass">
</p>
<p> </p>
<p>
<input type="SUBMIT" name="Submit" value="Enviar">
</p>
</form>
<?
}
if($_GET['status']==2){
?>
<form name="alta_inmobiliaria" method="POST" action="2.php">
<p>nombre_empresa
<input type="text" name="nombre_empresa" value="<?echo $_SESSION['s_nombre_empresa']?>"><?echo($_SESSION['error_nombre_empresa'])?>
<br>
direccion
<input type="text" name="direccion" value="<?echo $_SESSION['s_direccion']?>">
<br>
cif_inmobiliaria
<input type="text" name="cif_inmobiliaria" value="<?echo $_SESSION['s_cif_inmobiliaria']?>"><?echo($_SESSION['error_cif_inmobiliaria'])?>
<br>
pais
<input type="text" name="pais" value="<?echo $_SESSION['s_pais']?>"><?echo($_SESSION['error_pais'])?>
<br>
provincia
<input type="text" name="provincia" value="<?echo $_SESSION['s_provincia']?>"><?echo($_SESSION['error_provincia'])?>
<br>
localidad
<input type="text" name="localidad" value="<?echo $_SESSION['s_localidad']?>"><?echo($_SESSION['error_localidad'])?>
<br>
codigo_postal
<input type="text" name="codigo_postal" value="<?echo $_SESSION['s_codigo_postal']?>"><?echo($_SESSION['error_codigo_postal'])?>
<br>
telefono
<input type="text" name="telefono" value="<?echo $_SESSION['s_telefono']?>"><?echo($_SESSION['error_telefono'])?>
<br>
fax
<input type="text" name="fax" value="<?echo $_SESSION['s_fax']?>"><?echo($_SESSION['error_fax'])?>
<br>
email
<input type="text" name="email" value="<?echo $_SESSION['s_email']?>">
<br>
login
<input type="text" name="login" value="<?echo $_SESSION['s_login']?>">
<br>
password
<input type="text" name="password" value="<?echo $_SESSION['s_password']?>">
<br>
confirmpass
<input type="text" name="confirmpass" value="<?echo $_SESSION['s_confirmpass']?>"><?echo($_SESSION['error_confirmpass'])?>
</p>
<p> </p>
<p>
<input type="SUBMIT" name="Submit" value="Enviar">
</p>
</form>
<?
unset($_SESSION["error_nombre_empresa"],$_SESSION["error_cif_inmobiliaria"],$_SESSION["error_pais"],
$_SESSION["error_provincia"],$_SESSION["error_localidad"],$_SESSION["error_codigo_postal"],
$_SESSION["error_telefono"],$_SESSION["error_fax"],$_SESSION["error_confirmpass"]);
if($_SESSION["error_nulos"]!=""){
?>
<script>
alert('campos vacios');
</script>
<?
}
if($_SESSION["error_cif_existe"]!=""){
?>
<script>
alert('cif existente');
</script>
<?
}
if($_SESSION["error_login_existe"]!=""){
?>
<script>
alert('login y password existentes');
</script>
<?
}
?>
<?
}
?>
</body>
</html>