By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,886 Members | 1,123 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,886 IT Pros & Developers. It's quick & easy.

Information Regarding $_Session and Extract

P: n/a
Hi ppl,

I am new to PHP. I would need some information on the following:

1. a) I wanted to know from where the data is extracted and stroed in
the global assocoative
arrays ( specifically what will be the contents of $_Session ?)
b) Is there any way by which i can get to know all the keys of the
arrays ( specifically what
are the Keys of $_Session ?)
extract($_GET);
extract($_POST);
extract($_COOKIE);
extract($_SERVER);
#extract($_SESSION);

Aug 23 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
kimi wrote:
Hi ppl,

I am new to PHP. I would need some information on the following:

1. a) I wanted to know from where the data is extracted and stroed in
the global assocoative
arrays ( specifically what will be the contents of $_Session ?)
Hi,

The content of $_SESSION is stored serialized in a file, that is stored
in the directory given in php.ini. Often some tmp directory on the machine.

Find it by using php_info().

b) Is there any way by which i can get to know all the keys of the
arrays ( specifically what
are the Keys of $_Session ?)
extract($_GET);
extract($_POST);
extract($_COOKIE);
extract($_SERVER);
#extract($_SESSION);
Use print_r() for this.
Don't forget to wrap the HTML <prearound it.
So:
echo "<pre>";
print_r($_POST);
echo "</pre>";

Regards,
Erwin Moller
Aug 23 '07 #2

P: n/a
kimi wrote:
I am new to PHP. I would need some information on the following:

1. a) I wanted to know from where the data is extracted and stroed in
the global assocoative
arrays ( specifically what will be the contents of $_Session ?)
This arrays are not only global. They are superglobal! It means you can
access it from everywhere.

See: http://www.php.net/manual/en/languag...predefined.php

It also descibes what you are asking for.
b) Is there any way by which i can get to know all the keys of the
arrays ( specifically what
are the Keys of $_Session ?)
http://www.php.net/array_keys
extract($_GET);
extract($_POST);
extract($_COOKIE);
extract($_SERVER);
This is VERY BAD! Its no reason to do things like this.

Ulf

--
_,
_(_p Ulf [Kado] Kadner
\<_)
^^
Aug 23 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.