Ver Mensaje Individual
  #3 (permalink)  
Antiguo 25/11/2009, 21:51
HalconVigia
 
Fecha de Ingreso: abril-2003
Ubicación: Mexico
Mensajes: 604
Antigüedad: 21 años
Puntos: 23
Pregunta Respuesta: como hacer que un script se llame a si mismo??

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 {   
?>
__________________
¡El Respeto al Derecho Ajeno Es la Paz!