Bueno aqui les dejo le codigo
1.- Primero el formulario de entrada
Código PHP:
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Pruebas Locas del Archisss</title>
</head>
<body>
<form action="sesion.php" method="post">
<br> Nombre: <input type="text" name="nombre" /> <br />
<br> Password: <input type="text" name="pass" /> <br />
<br> <input type="submit" name="Agregar" value="Agregar Usuario" />
<input type="submit" name="Modificar" value="Eliminar Usuario" />
</form>
</body>
</html>
Código PHP:
<?php
// Inicio la sesión
session_start();
// Voy por el login y el password
$login = $_POST['nombre'];
$password = $_POST['pass'];
// reviso si coincide
if ( $login == "archie" && $password == "1234") {
$_SESSION['UsuarioReg'] = "SI";// Coloco la variable de sesión 'estado'
$msg = "<a href=\"adentro.php\">Bienvenido " . $login . ">></a>";
} else {
$msg = "Datos erroneos!!. <a href=\"formulario.html\">Inténtelo de nuevo.</a>";
}
?>
<html>
<head><title>:: Valida ::</title></head>
<body>
<p style="text-align:center;"><?= $msg ?></p>
</form>
</body>
</html>
![en desacuerdo](http://static.forosdelweb.com/fdwtheme/images/smilies/dedosabajo.png)
Código PHP:
<?php
// Inicio la sesión
session_start();
?>
<html>
<head><title>:: Adentro ::</title></head>
<body>
<p style="text-align:center;">Tu estado de sesión es: <b><?= $_SESSION['UsuarioReg'] ?></b></p>
</body>
</html>
saludos y de antemano muchas gracias