Foros del Web » Programando para Internet » PHP »

sesiones en login

Estas en el tema de sesiones en login en el foro de PHP en Foros del Web. He leido sin entender la logica del uso de sesiones, quisiera si me pueden orientar, para hacer un login y acceso restringido a una web. ...
  #1 (permalink)  
Antiguo 27/09/2003, 16:20
Avatar de GaboMaKano  
Fecha de Ingreso: noviembre-2002
Ubicación: Viña del Mar - Chile
Mensajes: 323
Antigüedad: 21 años, 5 meses
Puntos: 2
Desacuerdo sesiones en login

He leido sin entender la logica del uso de sesiones, quisiera si me pueden orientar, para hacer un login y acceso restringido a una web.

en la pagina donde tengo el form de ingreso de login y pass, una vez que compruebo que existen cargo mi pagina restringida, en esa pagina debo iniciar y registrar la sesion????, y las paginas a las cuales accedo desde mi pagina restringida principal, leen si la sesion se registro buscandola por el nombre?????
Estoy medio confundio parece, help me!!!!
De ante mano gracias.
__________________
Exito!!
:censura:
Visita Uganet.cl
  #2 (permalink)  
Antiguo 27/09/2003, 17:26
Avatar de nuevo  
Fecha de Ingreso: mayo-2003
Ubicación: Spain
Mensajes: 2.009
Antigüedad: 20 años, 11 meses
Puntos: 2
Autentificator
Gestión de Usuarios PHP+Mysql+sesiones
by Pedro Noves V. (Cluster)
[email protected]

versión actual: v2.01 - 16/10/2002

http://phpcluster.host.sk/scripts/autentificator/


no hay mas palabras que leer el sabio consejo de Cluster
__________________
3w.valenciadjs.com
3w.laislatv.com
  #3 (permalink)  
Antiguo 28/09/2003, 06:52
 
Fecha de Ingreso: agosto-2003
Ubicación: España
Mensajes: 202
Antigüedad: 20 años, 8 meses
Puntos: 0
Mail i listo

eso es facilillo enviame un email i tendras algo completito cuando pueda tambien lo posteare en el foro, con ese email k me envies te dare un completo script, pero real no es ningun script prefabricado de esos
adioooo
mi email [email protected]
  #4 (permalink)  
Antiguo 28/09/2003, 07:38
Avatar de nuevo  
Fecha de Ingreso: mayo-2003
Ubicación: Spain
Mensajes: 2.009
Antigüedad: 20 años, 11 meses
Puntos: 2
q rule ese code, a ver que tiene de mejoras frente a los demas ;)
__________________
3w.valenciadjs.com
3w.laislatv.com
  #5 (permalink)  
Antiguo 28/09/2003, 21:56
O_O
 
Fecha de Ingreso: enero-2002
Ubicación: Santiago - Chile
Mensajes: 34.417
Antigüedad: 22 años, 3 meses
Puntos: 129
ivanguillen .. no entendí:

Cita:
pero real no es ningun script prefabricado de esos
sonó a "despectivo" .. pero bueno .. Mi script es"prefabricado" por qué es generérico .. además que es la base para armarte tu própio sistema de autentificación.

Por lo demás .. esperamos asiosos tu script para hecharle un vistazo.

Un saludo,
__________________
Por motivos personales ya no puedo estar con Uds. Fue grato haber compartido todos estos años. Igualmente los seguiré leyendo.
  #6 (permalink)  
Antiguo 28/09/2003, 22:43
Avatar de nuevo  
Fecha de Ingreso: mayo-2003
Ubicación: Spain
Mensajes: 2.009
Antigüedad: 20 años, 11 meses
Puntos: 2
xxxxdddddd que rule, que rule ese code......xxxxddd
__________________
3w.valenciadjs.com
3w.laislatv.com
  #7 (permalink)  
Antiguo 29/09/2003, 09:13
 
Fecha de Ingreso: agosto-2003
Ubicación: España
Mensajes: 202
Antigüedad: 20 años, 8 meses
Puntos: 0
aun no lo termine pero de momento tiene pa logearse, registrarse i poner aplicaciones seguras, aun que yo en ningun momento dije que los scripts prefavricados fueran malos
  #8 (permalink)  
Antiguo 29/09/2003, 11:46
Avatar de nuevo  
Fecha de Ingreso: mayo-2003
Ubicación: Spain
Mensajes: 2.009
Antigüedad: 20 años, 11 meses
Puntos: 2
pues tirale el code.... macho.... a ver que es lo que has hecho... si hablas de una cosa has de ponerla, no puedes dejar a la gente asi...

venga, a ver ese code, ;)
__________________
3w.valenciadjs.com
3w.laislatv.com
  #9 (permalink)  
Antiguo 30/09/2003, 10:24
 
Fecha de Ingreso: agosto-2003
Ubicación: España
Mensajes: 202
Antigüedad: 20 años, 8 meses
Puntos: 0
ok
  #10 (permalink)  
Antiguo 30/09/2003, 10:35
 
Fecha de Ingreso: agosto-2003
Ubicación: España
Mensajes: 202
Antigüedad: 20 años, 8 meses
Puntos: 0
aki dejo el code
Index.php
Código PHP:
<html>
<head>
    <title>Autentificación PHP</title>
</head>
<body>
<h1>Autentificación PHP</h1>
<form action="entrar.php" method="POST">
<table align="center" width="225" cellspacing="2" cellpadding="2" border="0">
<tr>
    <td colspan="2" align="center" 
    <?if ($_GET["errorusuario"]=="si"){?>
        bgcolor=red><span style="color:ffffff"><b>Datos incorrectos</b></span>
    <?}else{?>
        bgcolor=#cccccc>Introduce tu clave de acceso
    <?}?></td>
</tr>
<tr>
    <td align="right">Usuario:</td>
    <td><input type="Text" name="nick" size="8" maxlength="50"></td>
</tr>
<tr>
    <td align="right">Pasword:</td>
    <td><input type="pass" name="pass" size="8" maxlength="50"></td>
</tr>
<tr>
    <td colspan="2" align="center"><input type="Submit" value="ENTRAR"></td>
</tr>
</table>
</form>
<br>
<br>

</body>
</html>
entrar.php
Código PHP:
<?php

 
include('conexion.php'); 
 
//realizamos una consulta a la bd
$query mysql_query("SELECT * FROM usuarios"$conexion);

//definimos un array
$array mysql_fetch_array($query);

//realizamos un array de los campos que contienen el usuario y la contraseña
$arrayusuario = ($array["nick"]); 
$arraypassword = ($array["password"]);
$arraynombre = ($array["nombre"]);
$arraymail = ($array["email"]);
$arraypregunta = ($array["pregunta_psw"]);
$arrayrespuesta = ($array["respuesta_psw"]);
$arraywebperso = ($array["web_perso"]);
$arraysexo = ($array["sexo"]);
$arraydia = ($array["fecha_dia"]);
$arraymes = ($array["fecha_mes"]);
$arrayano = ($array["fecha_ano"]);


//vemos si el usuario y contraseña es váildo
//llamamos los arrays en las siguiente linea.
if ($_POST["nick"]=="$arrayusuario" && $_POST["pass"]=="$arraypassword"){
//usuario y contraseña válidos
//defino una sesion y guardo datos
session_start();
session_register("autentificado");
session_register('arrayusuario');
session_register('arraypassword');
session_register('arraynombre');
session_register('arraymail');
session_register('arraypregunta');
session_register('arrayrespuesta');
session_register('arraywebperso');
session_register('arraysexo');
session_register('arraydia');
session_register('arraymes');
session_register('$arrayano');
$autentificado "SI";
header ("Location: aplicacion.php");
}else {
//si no existe le mando otra vez a la portada
header("Location: index.php?errorusuario=si");
}
?>
registro.php
Código PHP:
<html>

<head>
<meta http-equiv="Content-Language" content="es">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Registro de Usuarios</title>
<?php 

$conexion 
mysql_connect('mysql.webcindario.com','djmoll','177777');

mysql_select_db ("djmoll"$conexion);


function 
quitar($mensaje

$mensaje str_replace("<","&lt;",$mensaje); 
$mensaje str_replace(">","&gt;",$mensaje); 
$mensaje str_replace("\'","'",$mensaje); 
$mensaje str_replace('\"',"&quot;",$mensaje); 
$mensaje str_replace("\\\\","\",$mensaje); 
return 
$mensaje


if(
trim($HTTP_POST_VARS["nick"]) != ""

$sql "SELECT id FROM usuarios WHERE nick='".quitar($HTTP_POST_VARS["nick"])."'"
$result mysql_query($sql); 
if(
$row mysql_fetch_array($result)) 

echo 
"Error, Usuario o email ya esta en uso"

else 

$sql "INSERT INTO usuarios (nick,password,nombre,web_perso,respuesta_psw,pregunta_psw,sexo,fecha_mes,fecha_dia,fecha_ano,email) VALUES ("
$sql .= "'".quitar($HTTP_POST_VARS["nick"])."'"
$sql .= ",'".quitar($HTTP_POST_VARS["pass"])."'"
$sql .= ",'".quitar($HTTP_POST_VARS["nombre"])."'"
$sql .= ",'".quitar($HTTP_POST_VARS["url"])."'"
$sql .= ",'".quitar($HTTP_POST_VARS["respuesta_psw"])."'"
$sql .= ",'".quitar($HTTP_POST_VARS["pregunta_psw"])."'";
$sql .= ",'".quitar($HTTP_POST_VARS["sexo"])."'";  
$sql .= ",'".quitar($HTTP_POST_VARS["fecha_mes"])."'"
$sql .= ",'".quitar($HTTP_POST_VARS["fecha_dia"])."'";
$sql .= ",'".quitar($HTTP_POST_VARS["fecha_ano"])."'";  
$sql .= ",'".quitar($HTTP_POST_VARS["mail"])."'"
$sql .= ")"
mysql_query($sql); 
echo 
"Registro exitoso!"?> <script lenguage="javascript"> window.location.href="index.php"</script> <script lenguage="javascript"> 
window.alert("Registro exitoso, a sido dirigido a la pagina principal.")
</script> <?

mysql_free_result($result); 

else 

echo 
"Debe llenar como minimo los campos de email y password"

mysql_close(); 
?> 
</head>

<body bgcolor="#3366FF">
</body>

</html>
  #11 (permalink)  
Antiguo 30/09/2003, 10:39
 
Fecha de Ingreso: agosto-2003
Ubicación: España
Mensajes: 202
Antigüedad: 20 años, 8 meses
Puntos: 0
registro.htm
Código PHP:
<html>

<
head>
<
meta http-equiv="Content-Language" content="es">
<
meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<
meta name="ProgId" content="FrontPage.Editor.Document">
<
meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<
title>registro en LisY Web </title>
<
style type="text/css">
<!--
input font-familyTahomaVerdanaArialfont-size18pxcolor#FFFFFF; background-color: #6699CC; border: #000099; border-style: solid; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px}
select font-familyTahomaVerdanaArialfont-size12pxcolor#FFFFFF; background-color: #6699CC; border: #000099; border-style: solid; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px}

-->
</
style>

</
head>

<
body bgcolor="#0066CC" text="#FF9933"><font face="Trebuchet MS">

<
p><h1 align="center">Registro de Usuarios</h1>
<
form method="POST" action="registro.php">
  <
table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="88%" id="AutoNumber1" height="223">
    <
tr>
      <
td width="63%" bgcolor="#000080" height="26">Descripción</td>
      <
td width="37%" bgcolor="#000080" height="26">Datos:</td>
    </
tr>
    <
tr>
      <
td width="63%" bgcolor="#008080" height="78">Aquí debe de ingresar su 
      nombre de Usuario
este será utilizado para ingresar en nuestros servicios 
      extras
. </td>
      <
td width="37%" bgcolor="#008080" height="78">
      <
p align="center"><input type="text" name="nick" size="20"></td>
    </
tr>
    <
tr>
      <
td width="63%" bgcolor="#008080" height="26">Su emailDebe ingresar aquí 
      su email
en caso de que perdiera su contraseña nosotros se la 
      reenviaremos por email
.</td>
      <
td width="37%" bgcolor="#008080" height="26">
      <
p align="center"><input type="text" name="mail" size="20"></td>
    </
tr>
    <
tr>
      <
td width="63%" bgcolor="#008080" height="26">Su ContraseñaDebe ingresar 
      aquí su contraseña
para ingresar en nuestros servicios extras es 
      necesaria
Lógico no?</td>
      <
td width="37%" bgcolor="#008080" height="26">
      <
p align="center"><input type="text" name="pass" size="20"></td>
    </
tr>
    <
tr>
      <
td width="63%" bgcolor="#000080" height="1">DATOS PERSONALES:</td>
      <
td width="37%" bgcolor="#000080" height="1">DATOS:</td>
    </
tr>
    <
tr>
      <
td width="63%" bgcolor="#008080" height="26">Tu nombrees necesario</td>
      <
td width="37%" bgcolor="#008080" height="26">
      <
p align="center"><input type="text" name="nombre" size="20"></td>
    </
tr>
    <
tr>
      <
td width="63%" bgcolor="#008080" height="26">Tu pagina websi nos dice 
      la su pagina web
puede que la publiquemosdepende de su calidad</td>
      <
td width="37%" bgcolor="#008080" height="26">
      <
p align="center"><font face="Trebuchet MS">

      <
input type="text" name="url" size="20"></font></td>
    </
tr>
    <
tr>
      <
td width="63%" bgcolor="#008080" height="26">Pregunta secretasi olvida 
      su contraseña se enviaremos la misma a su email en caso de responder 
      correctamente a esta pregunta
</td>
      <
td width="37%" bgcolor="#008080" height="26">
      <
p align="center"><font face="Trebuchet MS">

      <
input type="text" name="pregunta_psw" size="20"></font></td>
    </
tr>
    <
tr>
      <
td width="63%" bgcolor="#008080" height="26">esta es la respuesta de la 
      pregunta anterior introducid algo de lo que os acordéis fácilmente por 
      ejemplo vuestra peli favorita
</td>
      <
td width="37%" bgcolor="#008080" height="26">
      <
p align="center"><font face="Trebuchet MS">

      <
input type="text" name="respuesta_psw" size="20"></font></td>
    </
tr>
    <
tr>
    </
tr>
    <
tr>
      <
td width="63%" bgcolor="#008080" height="25">Tu sexocual es tu sexo 
      masculino o femenino
?</td>
      <
td width="37%" bgcolor="#008080" height="25">Masculino<input type="radio" value="Hombre" name="sexo">&nbsp;&nbsp
      
Femenino<input type="radio" name="sexo" value="Mujer"></td>
    </
tr>
    <
tr>
      <
td width="63%" bgcolor="#008080" height="26">Fecha de nacimientopon 
      aqui tu fecha de nacimiento
no valoramos tu edad es igual si tienes 11 
      años que 100. DD
.MMMMMM.AAAA</td>
      <
td width="37%" bgcolor="#008080" height="26">
      <
select size="1" name="fecha_dia">
      <
option>1</option>
      <
option>2</option>
      <
option>3</option>
      <
option>4</option>
      <
option>5</option>
      <
option>6</option>
      <
option>7</option>
      <
option>8</option>
      <
option>9</option>
      <
option>10</option>
      <
option>11</option>
      <
option>12</option>
      <
option>13</option>
      <
option>14</option>
      <
option>15</option>
      <
option>16</option>
      <
option>17</option>
      <
option>18</option>
      <
option>19</option>
      <
option>20</option>
      <
option>21</option>
      <
option>22</option>
      <
option>23</option>
      <
option>24</option>
      <
option>25</option>
      <
option>26</option>
      <
option>27</option>
      <
option>28</option>
      <
option>29</option>
      <
option>30</option>
      <
option>31</option>
      </
select><select size="1" name="fecha_mes">
      <
option value="Enero" >Enero</option>

      <
option value="Febrero">Febrero</option>
<
option value="Marzo">Marzo</option>
<
option value="Abril">Abril</option>
<
option value="Mayo">Mayo</option>
<
option value="Junio">Junio</option>
<
option value="Julio">Julio</option>
<
option value="Agosto">Agosto</option>
<
option value="Septiembre">Septiembre</option>
<
option value="Octubre">Octubre</option>
<
option value="Noviembre">Noviembre</option>
<
option value="Noviembre">Diciembre</option>
</
select></select><input type="text" name="fecha_ano" size="9"></td>
    </
tr>
    </
table>
  <
p align="left">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  <
input type="submit" value="Enviar" name="sumbit"><input type="reset" value="Restablecer" name="B2"></p>
</
form>
</
p>

</
font></body>

</
html
seguridad.php
Código PHP:
<?
//Inicio la sesión
session_start();

//COMPRUEBA QUE EL USUARIO ESTA AUTENTIFICADO
if ($_SESSION["autentificado"] != "SI") {
    
//si no existe, envio a la página de autentificacion
    
header("Location: index.php");
    
//ademas salgo de este script
    
exit();
}else{ 
include (
"aplicacion.php");

 }

 


 
?>
aplicacion.php
Código PHP:
<?include ("seguridad.php");?>
<html>
<head>
    <title>Aplicación segura</title>
</head>

<body>
<h1>Si estás aquí es que te has autentificado</h1>
<br>
----
<br>
Aplicación segura
<br>
----
<br>
<br>
<a href="salir.php">Salir</a>
</body>
</html>
salir.php
Código PHP:
<?
session_start
();
session_destroy();
?>
<html>
<head>
    <title>Has salido!!</title>
</head>

<body>

Gracias por tu acceso
<br>
<br>
<a href="index.php">Formulario de autentificación</a>

</body>
</html>
BUENO AKI FALTA UN ARCHIVO CONEXION.PHP ESE DEPENDE DE TI, COMO DIRIA NUEVO ESTO SE PUEDE MEJORAR MUCHO PERO NO PUEDO DAR LA VERSION COMPLETA espero aber quedado bien con ustedes, nuevo, no te molestes con migo, no soy ningun chulo
  #12 (permalink)  
Antiguo 30/09/2003, 10:49
 
Fecha de Ingreso: agosto-2003
Ubicación: España
Mensajes: 202
Antigüedad: 20 años, 8 meses
Puntos: 0
registro.htm
Código PHP:
<html>

<
head>
<
meta http-equiv="Content-Language" content="es">
<
meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<
meta name="ProgId" content="FrontPage.Editor.Document">
<
meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<
title>registro en LisY Web </title>
<
style type="text/css">
<!--
input font-familyTahomaVerdanaArialfont-size18pxcolor#FFFFFF; background-color: #6699CC; border: #000099; border-style: solid; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px}
select font-familyTahomaVerdanaArialfont-size12pxcolor#FFFFFF; background-color: #6699CC; border: #000099; border-style: solid; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px}

-->
</
style>

</
head>

<
body bgcolor="#0066CC" text="#FF9933"><font face="Trebuchet MS">

<
p><h1 align="center">Registro de Usuarios</h1>
<
form method="POST" action="registro.php">
  <
table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="88%" id="AutoNumber1" height="223">
    <
tr>
      <
td width="63%" bgcolor="#000080" height="26">Descripción</td>
      <
td width="37%" bgcolor="#000080" height="26">Datos:</td>
    </
tr>
    <
tr>
      <
td width="63%" bgcolor="#008080" height="78">Aquí debe de ingresar su 
      nombre de Usuario
este será utilizado para ingresar en nuestros servicios 
      extras
. </td>
      <
td width="37%" bgcolor="#008080" height="78">
      <
p align="center"><input type="text" name="nick" size="20"></td>
    </
tr>
    <
tr>
      <
td width="63%" bgcolor="#008080" height="26">Su emailDebe ingresar aquí 
      su email
en caso de que perdiera su contraseña nosotros se la 
      reenviaremos por email
.</td>
      <
td width="37%" bgcolor="#008080" height="26">
      <
p align="center"><input type="text" name="mail" size="20"></td>
    </
tr>
    <
tr>
      <
td width="63%" bgcolor="#008080" height="26">Su ContraseñaDebe ingresar 
      aquí su contraseña
para ingresar en nuestros servicios extras es 
      necesaria
Lógico no?</td>
      <
td width="37%" bgcolor="#008080" height="26">
      <
p align="center"><input type="text" name="pass" size="20"></td>
    </
tr>
    <
tr>
      <
td width="63%" bgcolor="#000080" height="1">DATOS PERSONALES:</td>
      <
td width="37%" bgcolor="#000080" height="1">DATOS:</td>
    </
tr>
    <
tr>
      <
td width="63%" bgcolor="#008080" height="26">Tu nombrees necesario</td>
      <
td width="37%" bgcolor="#008080" height="26">
      <
p align="center"><input type="text" name="nombre" size="20"></td>
    </
tr>
    <
tr>
      <
td width="63%" bgcolor="#008080" height="26">Tu pagina websi nos dice 
      la su pagina web
puede que la publiquemosdepende de su calidad</td>
      <
td width="37%" bgcolor="#008080" height="26">
      <
p align="center"><font face="Trebuchet MS">

      <
input type="text" name="url" size="20"></font></td>
    </
tr>
    <
tr>
      <
td width="63%" bgcolor="#008080" height="26">Pregunta secretasi olvida 
      su contraseña se enviaremos la misma a su email en caso de responder 
      correctamente a esta pregunta
</td>
      <
td width="37%" bgcolor="#008080" height="26">
      <
p align="center"><font face="Trebuchet MS">

      <
input type="text" name="pregunta_psw" size="20"></font></td>
    </
tr>
    <
tr>
      <
td width="63%" bgcolor="#008080" height="26">esta es la respuesta de la 
      pregunta anterior introducid algo de lo que os acordéis fácilmente por 
      ejemplo vuestra peli favorita
</td>
      <
td width="37%" bgcolor="#008080" height="26">
      <
p align="center"><font face="Trebuchet MS">

      <
input type="text" name="respuesta_psw" size="20"></font></td>
    </
tr>
    <
tr>
    </
tr>
    <
tr>
      <
td width="63%" bgcolor="#008080" height="25">Tu sexocual es tu sexo 
      masculino o femenino
?</td>
      <
td width="37%" bgcolor="#008080" height="25">Masculino<input type="radio" value="Hombre" name="sexo">&nbsp;&nbsp
      
Femenino<input type="radio" name="sexo" value="Mujer"></td>
    </
tr>
    <
tr>
      <
td width="63%" bgcolor="#008080" height="26">Fecha de nacimientopon 
      aqui tu fecha de nacimiento
no valoramos tu edad es igual si tienes 11 
      años que 100. DD
.MMMMMM.AAAA</td>
      <
td width="37%" bgcolor="#008080" height="26">
      <
select size="1" name="fecha_dia">
      <
option>1</option>
      <
option>2</option>
      <
option>3</option>
      <
option>4</option>
      <
option>5</option>
      <
option>6</option>
      <
option>7</option>
      <
option>8</option>
      <
option>9</option>
      <
option>10</option>
      <
option>11</option>
      <
option>12</option>
      <
option>13</option>
      <
option>14</option>
      <
option>15</option>
      <
option>16</option>
      <
option>17</option>
      <
option>18</option>
      <
option>19</option>
      <
option>20</option>
      <
option>21</option>
      <
option>22</option>
      <
option>23</option>
      <
option>24</option>
      <
option>25</option>
      <
option>26</option>
      <
option>27</option>
      <
option>28</option>
      <
option>29</option>
      <
option>30</option>
      <
option>31</option>
      </
select><select size="1" name="fecha_mes">
      <
option value="Enero" >Enero</option>

      <
option value="Febrero">Febrero</option>
<
option value="Marzo">Marzo</option>
<
option value="Abril">Abril</option>
<
option value="Mayo">Mayo</option>
<
option value="Junio">Junio</option>
<
option value="Julio">Julio</option>
<
option value="Agosto">Agosto</option>
<
option value="Septiembre">Septiembre</option>
<
option value="Octubre">Octubre</option>
<
option value="Noviembre">Noviembre</option>
<
option value="Noviembre">Diciembre</option>
</
select></select><input type="text" name="fecha_ano" size="9"></td>
    </
tr>
    </
table>
  <
p align="left">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  <
input type="submit" value="Enviar" name="sumbit"><input type="reset" value="Restablecer" name="B2"></p>
</
form>
</
p>

</
font></body>

</
html
seguridad.php
Código PHP:
<?
//Inicio la sesión
session_start();

//COMPRUEBA QUE EL USUARIO ESTA AUTENTIFICADO
if ($_SESSION["autentificado"] != "SI") {
    
//si no existe, envio a la página de autentificacion
    
header("Location: index.php");
    
//ademas salgo de este script
    
exit();
}else{ 
include (
"aplicacion.php");

 }

 


 
?>
aplicacion.php
Código PHP:
<?include ("seguridad.php");?>
<html>
<head>
    <title>Aplicación segura</title>
</head>

<body>
<h1>Si estás aquí es que te has autentificado</h1>
<br>
----
<br>
Aplicación segura
<br>
----
<br>
<br>
<a href="salir.php">Salir</a>
</body>
</html>
salir.php
Código PHP:
<?
session_start
();
session_destroy();
?>
<html>
<head>
    <title>Has salido!!</title>
</head>

<body>

Gracias por tu acceso
<br>
<br>
<a href="index.php">Formulario de autentificación</a>

</body>
</html>
BUENO AKI FALTA UN ARCHIVO CONEXION.PHP ESE DEPENDE DE TI, COMO DIRIA NUEVO ESTO SE PUEDE MEJORAR MUCHO PERO NO PUEDO DAR LA VERSION COMPLETA espero aber quedado bien con ustedes, nuevo, no te molestes con migo, no soy ningun chulo
  #13 (permalink)  
Antiguo 30/09/2003, 17:08
Avatar de nuevo  
Fecha de Ingreso: mayo-2003
Ubicación: Spain
Mensajes: 2.009
Antigüedad: 20 años, 11 meses
Puntos: 2
Cita:
Mensaje Original por ivanguillen

..., COMO DIRIA NUEVO ESTO SE PUEDE MEJORAR MUCHO PERO NO PUEDO DAR LA VERSION COMPLETA espero aber quedado bien con ustedes, nuevo, no te molestes con migo, no soy ningun chulo [/B]

yo solo diria esto...

ESTO SE PUEDE MEJORAR MUCHO
__________________
3w.valenciadjs.com
3w.laislatv.com
  #14 (permalink)  
Antiguo 30/09/2003, 20:32
Avatar de McManaman  
Fecha de Ingreso: agosto-2003
Ubicación: Ecuador - Guayaquil
Mensajes: 119
Antigüedad: 20 años, 7 meses
Puntos: 0
je je je
__________________
...Hay unos que saben TODO de nada y otros que saben NADA de TODO... think about it
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 23:24.