RE: [PHP] Session confusion again :( - Thanks!
| From: | Chris W. Parker | Date: | Wed, 14 Apr 2004 16:47:57 +0000 |
| Subject: | RE: [PHP] Session confusion again :( - Thanks! | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-183351@lists.php.net to get a copy of this message | ||
BOOT <mailto:pfine@of-law.com>
on Wednesday, April 14, 2004 9:40 AM said:
> What I can't understand is why Test1 shows as nothing, while
> Test2 shows the value I wanted. Thanks a lot!
[snip]
> $_SESSION['element_countp'] = count($p_lnames);
> echo "TEST 1".$element_countp;
>
> $element_countp = $_SESSION['element_countp'];
> echo "TEST 2".$element_countp;
because in test 1 $element_countp has not been assigned anything yet.
$_SESSION['element_countp'] and $element_countp are *not* the same
variable (it appears that you think they are).
in test 2 you assign the value of $_SESSION['element_countp'] to
$element_countp so that's why test 2 works.
hth,
chris.