Re: Session problem
| From: | Justin French | Date: | Wed, 01 Jan 2003 23:08:40 +0000 |
| Subject: | Re: Session problem | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-129885@lists.php.net to get a copy of this message | ||
on 02/01/03 9:46 AM, Andrew Williams (andrew.williams@peopletelecom.com.au)
wrote:
> I have been messing with PHP 4 on a windows 2000 machine using apache and am
> having trouble getting sessions to run.
I'm going to assume PHP > 4.1 ????
I'm also going to assume you're allowing cookies on your browser???
> session_register_var.php
change your script to:
<?
// set up a session
session_start();
// register the variable to the session
$_SESSION['my_favourite_colour'] = "blue";
// show a hyperlink to get to the next page
echo "<A HREF='show_session_var.php'>Click here to go to the next
page</A>";
?>
> and
> show_session_var.php
change this script to:
<?
// continue using the session
session_start();
// show the variable's value
echo "My favourite colour is... ".$_SESSION['my_favourite_colour'];
?>
lemme know how you go
Justin French