I have just installed php5 on my PC.
my first file ses1.php conatins following code.
<?php
session_start();
echo $_SESSION['mmm'] = "roshan";
$_POST['xyz'][0] = 'aaa';
$_POST['xyz'][1] = 'bbb';
$_SESSION['abc'][1] = $_POST['xyz'];
$_SESSION['abc'][2] = 'sample';
echo "<br>";
print_r($_SESSION['abc']);
?>
<form action="ses2.php" method="POST">
<input type="hidden" name="txt" value="dash">
<input type="submit" value="OK">
</form>
On submit of ses1.php it goes to ses2.php ( where I am trying to display
session variables but it is giving me following error)
ses2.php :-
<?php
session_start();
echo $_POST['txt'];
print_r($_SESSION);
echo $_SESSION['mmm'];
print_r($_SESSION['abc']);
?>
dashArray ( )
Notice: Undefined index: mmm in C:\Program Files\Apache Software
Foundation\Apache2.2\htdocs\ses2.php on line 5
Notice: Undefined index: abc in C:\Program Files\Apache Software
Foundation\Apache2.2\htdocs\ses2.php on line 6
php.ini setting is as :-
session Session Support enabled Registered save handlers
files user Registered serializer handlers php php_binary wddx
Directive Local Value Master Value session.auto_start Off Off
session.bug_compat_42 Off Off session.bug_compat_warn On On
session.cache_expire 180 180 session.cache_limiter nocache nocache
session.cookie_domain no value no value session.cookie_httponly Off Off
session.cookie_lifetime 0 0 session.cookie_path \ \
session.cookie_secure Off Off session.entropy_file no value no value
session.entropy_length 0 0 session.gc_divisor 1000 1000
session.gc_maxlifetime 1440 1440 session.gc_probability 1 1
session.hash_bits_per_character 5 5 session.hash_function 0 0
session.name PHPSESSID PHPSESSID session.referer_check no value no value
session.save_handler files files session.save_path no value no value
session.serialize_handler php php session.use_cookies On On
session.use_only_cookies Off Off session.use_trans_sid 0 0
Send free SMS to your Friends on Mobile from your Yahoo! Messenger. Download
Now! http://messenger.yahoo.com/download.php
[Non-text portions of this message have been removed]