Re: [PHP4BETA] Sessions strange behaviour. (fwd)
| From: | Roberto Diaz | Date: | Sun, 14 Nov 1999 11:21:58 +0000 |
| Subject: | Re: [PHP4BETA] Sessions strange behaviour. (fwd) | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-6248@lists.php.net to get a copy of this message | ||
> FWIW, this works for me, thanks to your input for the idea;
>
> # cat page1.php
> <?php
------------- snip-------------------------
> Does this work for you ?
>
> --markc
>
Yes it is working now.. :??????? well i still have a few troubles with
session_destroy();
This is my code:
------------------------------------------------------------------------
[root@sirio htdocs]# cat test1.php
<?
if(isset($nueva) && $nueva == 1) session_destroy();
// ******* what I want is to destroy my session so i get $var2 == 1
// ******* again, Whats wrong :?????????????????
session_start();
if(!isset($sesion)){
$var = "Hello";
$var2 = 1;
$sesion = 1;
session_register("var");
session_register("var2");
session_register("sesion");
}
?>
<html>
<body bgcolor="#ffffff">
<center>
<p><h1> Registro de variables </h1></p><hr></hr>
<p><h3>Tu variables registrada $var:</h3> <?echo $var?></p>
<p><h3>Tu variable registrada $var2:</h3> <?echo $var2?></p>
<p>esta es la pagina 1. hacer click <a href="test2.php">aqui</a> para ir
a
la
pagina 2.</p>
</body>
</html>
[root@sirio htdocs]# cat test2.php
<?session_start();?>
<html>
<body bgcolor="FFFFFF">
<center>
<h1>Y tus variables de sesion son:<h1><br></br>
<p>la variable $var: <?echo $var?></p>
<p>la varialbe $var2:<?echo $var2?></p>
<p>
y el identificador de sesion es: <? echo session_id(); ?>
</p>
<?$var2++?>
<p>
<font size=3> volver a la pagina 1 <a href="test1.php">pulsar
aqui</a></font>
<p>
<font size=3> para crear nueva sesion pulsar </font>
</p>
<form method="post" action="./test1.php">
<input type="hidden" name="nueva" value="1">
<input type="submit" value="aqui">
</form>
</p>
</body>
</html>
-------------------------------------------------------
Saludos
Roberto Díaz <rdiazmar@nova.es>
http://www.linuxfocus.org/developer/Roberto