Yes, it is, though it probably won't work within a double-quoted string, in which case you'll probably want to concatenate it with the rest of the string, instead (or use something like printf() or sprintf()).
"Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
~ Terry Pratchett in Nation
No, the array key should not be quoted if using a variable.
My concern was whether or not the following would be "legal", but a little testing shows that it is, so that is not an issue.
PHP Code:
<?php session_start(); $id = 'foo'; $_SESSION[$id] = 'test'; echo "This is a $_SESSION[$id].";
So at this point I don't know what your actual question/issue is without more info and/or source code.
"Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
~ Terry Pratchett in Nation
I use session based logins and I've got some code here I use to automatically give the user links to his/her own files. You might find parts of it useful to you.
PHP Code:
<?php $mine = ($_SESSION['user_name']); $result = mysql_query("SELECT * FROM UploadedFiles WHERE username = '$mine'"); while ($row = mysql_fetch_array($result)){
Bookmarks