Quote:
Originally Posted by TheServant
You have the same session for the time that your browser is open, unless you destroy or unset that session. So I am a little confused how you think your session variables will get mixed up?
I am guessing you're worried that when item 1 is added, it will overwrite item 2? Well you can use arrays inside session variables, so maybe something for you to look into.
Anyway to answer your question, you can get the session id by using:
session_id() - returns the session id for the current session. If id is specified, it will replace the current session id.
You can find more info using google.
Hope that helps.
Hi!
Thanks for your answer. I think I already operate with arrays inside session variable, but I keep overwrite it. Here is what happens when the user click submit button:
[PHP]
if($_POST['putIntoArrayBtn']) { // 'putIntoArrayBtn' is my submit button
$name = $_POST['tableName'];
$fieldname = $_POST['fieldName']; //fetch all values in name='fieldName[]'
$fieldvalue = $_POST['fieldValue']; //fetch all values in name='fieldValue[]'
$_SESSION['mySession] = array("Tablename"=>$name, "Subject"=>$fieldname,"Value"=>$fieldvalue);
}
[/PHP]
But what happens when the user wants to make another input in my form. Then the operation happens again, and overwrites my input in $_SESSION['mySession'].
When I output the $_SESSION['mySession'] only the last stored info will come...
Any way around this problem, so that all tables will output calling my session variable ?