View Full Version : Resolved Setting a session to hold a value

03-07-2009, 03: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, 03:17 PM
$_SESSION['id'] = $keepid;

03-07-2009, 04: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, 04:40 PM
Yes if you have session_start(); at the top of your code.

03-07-2009, 10:19 PM
Ok thanks

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum