View Full Version : Resolved Setting a session to hold a value
03-07-2009, 04:01 PM
I forgot how to put a value into a session to hold over multiple pages.
Like you are editing user ID 104. So 104 needs to be the value in the session so I can query the ID and update as needed. It was something like this?
$keepid = SESSION['id'];
03-07-2009, 04:17 PM
$_SESSION['id'] = $keepid;
03-07-2009, 05:31 PM
Thats for a form?
<input type="text" name="myname" value="">
and after the isset. Do this?
$keepname = $_POST['myname'];
$_SESSION['myname'] = $keepname;
So then I can pull the session like this?
echo "My name is ".$_session['myname']."";
03-07-2009, 05:40 PM
Yes if you have session_start(); at the top of your code.
03-07-2009, 11:19 PM
EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum
vBulletin® v3.8.2, Copyright ©2000-2013, Jelsoft Enterprises Ltd.