buenas!!!
aqui pongo un tramo del codigo para explicarme mejor
Código PHP:
<?
session_start();
$accion = $_GET['accion'];
if($accion == 'salir'){
session_unset();
session_destroy();
header("location: ".$_SERVER['PHP_SELF']); // aqui funciona perfecto pero los demas no
}
if(!isset($_SESSION['login'])){
if($accion == 'entra'){
if($_POST['usNick']== ""){
?>
<HTML>
<HEAD>
<TITLE>Inicio se Sesion</TITLE>
</HEAD>
<BODY>
<!-- Esta linea la Cambie asi y no funciona
<form action=".<?echo $_SERVER['PHP_SELF']);?>." ?accion=entra" method="post" name="form1">
Actualemente esta como la linea de abajo y funciona perfecto...
-->
<form action="index.php?accion=entra" method="post" name="form1">
<p><strong> Usuario :<br>
<input name="usNick" type="text" id="usNick">
<br>
Contraseña :<br>
<input name="usCon" type="text" id="usCon">
</strong></p>
<p>
<input type="submit" name="Submit" value="Entrar">
</p>
</form>
</BODY>
</HTML>
<? } else {
// Codigo..........
header('location: index.php'); // Esto quiero que se pueda llamar a si mismo
}
if($key2 == "no"){
echo "La contraseña esta mal.";
exit();
}
} }
else if($accion == 'registra'){
if($_POST['usNick']== ""){
?>
<HTML>
<HEAD>
<TITLE>Registro Nuevo</TITLE>
</HEAD>
<BODY>
<form name="form1" method="post" action="index.php?accion=registra">
Usuario :
<br><input name="usNick" type="text" id="usNick">
<br>
Contraseña :<br>
<input name="con" type="text" id="con">
<br>
Pais : <br>
<input name="pai" type="text" id="pai">
<br>
Email :<br>
<input name="em" type="text" id="em">
<br>
<label>
<input type="submit" name="Submit" value="Registrar">
</label>
</form>
</BODY>
</HTML>
<? } else {
// Codigo............
header("location: index.php"); //Esto Quiero simplificar
}
}
} else { ?>