Forum Moderators: coopster
anyways, to pass some data from one page to another this is how u proceed.
1. set session first
<?php
/*first you start the session. in all the pages where u
want the session data to be used u need to sstart the
session with the line below */
session_start();
// Register session with a key with the value 'test'
$_SESSION['skin'] = 'test';
?>
2. get session value
/*Now when u want to use the session in another page, do as follows. on top of the page use */
session_start();
/*then save session value in varable ()dont have to,
but makes life easier. if u have several session values they are all in the $_SESSION, which is a global array, so to get ur desired session value, use the name like this
$data = $_SESSION['test'];
//then u do whatever u want to do
//like
echo $data;
hope it helps,
k
thanks for your reply, but i got some questions, please bare w/me as I am kinda a php newbie.
So if my site has 10 pages, I would have to put session_start() in all 10 pages? Or do I just start the session on the first page and then get the session value for those other pages?
// Register session with a key with the value 'test'
$_SESSION['skin'] = 'test';
I don't understand what the above means, what's 'skin' for or represent?
Thank You.
in order to to retrieve the session variable, in our case 'test', you would have to first start the session. and yes you will have to do that induvidually on each page. this way the session data will be available to that particular page.
hope this helps...
ps. dont worry, i was new once as well, besides you just found the best forum on the net :). dont take my word for it, stay and find out..
kumar