Secret to using $_POST and $_SESSION variables
Posted: Thu Apr 14, 2005 11:03 pm
Hi again,
For today's hard-to-find-the-answer amateur Q&A, I would like to consider the esteemed $_POST and $_SESSION variables.
I need to trap some of the $_POST variables and use them in local manipulations without altering their values. I thought it would be straightforward, but these case tell me I'm going to run into a problem.
I tried
and
to no avail. BUT, if I change the same lines in the code to...
and
Can someone point me to an explanation why the first sets of code don't work but the second set does? I assume it has to do with rules regarding the assignment of global (?) variables. But, I cannot find the rules in writing.
Thanks,
For today's hard-to-find-the-answer amateur Q&A, I would like to consider the esteemed $_POST and $_SESSION variables.
I need to trap some of the $_POST variables and use them in local manipulations without altering their values. I thought it would be straightforward, but these case tell me I'm going to run into a problem.
I tried
Code: Select all
$new_action = $_POST['action'];
if ($admin_auth == "TRUE" && $new_action == 3) {
.......Code: Select all
$user_ident = $_SESSION['userid']
if ($user_ident = $localdata[user_id]) {
......Code: Select all
if ($admin_auth == "TRUE" && $_POST['action'] == 3){
.....Code: Select all
if $_SESSION['user_id'] = $localdata[user_id]) {
......Thanks,