$_SESSION question
From: toufik toufik (toufiki_at_sympatico.ca)
Date: 01/29/04
- Next message: dan: "Re: PHP , url and Google"
- Previous message: Andy Hassall: "Re: RegExp pattern to scan for NO HTML tags - need help"
- Next in thread: Andy Hassall: "Re: $_SESSION question"
- Reply: Andy Hassall: "Re: $_SESSION question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 29 Jan 2004 17:36:42 -0500
Hi,
I've a file login.php that create a session, register a variable(myVar) and
call (include) another file login1.php in the server side.
I need to use the registred variable in the second file but
$_SESSION["myVar"] is empty.
here is a simplified example of my problem, the command echo
($_SESSION["myVar"]) isn't displaying any thing
login.php :
========
<?php
$myVar="test"
session_start();
session_register("myVar");
include("login1.php");
?>
login1.php :
=======
<?php
session_start();
echo ($_SESSION["myVar"]);
?>
Note: I need to have myVar in the $_SESSION array in login1.php because in
other context I call it from the browser, so I'll the same code.
Thanks.
- Next message: dan: "Re: PHP , url and Google"
- Previous message: Andy Hassall: "Re: RegExp pattern to scan for NO HTML tags - need help"
- Next in thread: Andy Hassall: "Re: $_SESSION question"
- Reply: Andy Hassall: "Re: $_SESSION question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|