Session variable index error
Posted: Wed Sep 27, 2006 1:41 pm
feyd | Please use
//form test2.php
echo "here" . $_SESSION['logged'];
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
url would be
/localhost.com/index.php?action=TEST1
//index.phpCode: Select all
session_start();
if ($action == "TEST1") {
include("test1.php");
} elseif ($action == "TEST2") { //edit user sales
include("test2.php");
}
//form test1.php
$_SESSION['logged'] = "logged";
echo $_SESSION['logged'] ;//form test2.php
echo "here" . $_SESSION['logged'];
Code: Select all
RECEIVE error and my session is not defined
Notice: Undefined index: logged in C:\Program Files\Apache2\htdocs\test\test2.php on line 3feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]