Re: Empty $_SESSION and $_POST ??
| From: | Miguel Cruz | Date: | Sat, 20 Apr 2002 00:13:13 +0000 |
| Subject: | Re: Empty $_SESSION and $_POST ?? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-93769@lists.php.net to get a copy of this message | ||
On Fri, 19 Apr 2002, Andre Dubuc wrote:
> Whenever I try:
>
> print("$_SESSION['sfname']); or print("$_POST['scity']
>
> I get a parse error "expecting 'T_STRING' . . ." -- obviously there's
> nothing
> in the array or I haven't set it.
You just have a simple syntax error.
You can use any of the following:
print $_SESSION['sfname'];
print "{$_SESSION['sfname']}";
print "${_SESSION['sfname']}";
But you can't put a bare array dereference inside a quoted string like you
tried above. You need to surround it with {curly braces} or take it
outside the quoted string.
miguel