Re: Sessions: Wath's my mistake??
| From: | Jason Wong | Date: | Sat, 17 May 2003 08:34:04 +0000 |
| Subject: | Re: Sessions: Wath's my mistake?? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-148009@lists.php.net to get a copy of this message | ||
On Saturday 17 May 2003 14:18, Tomás Liendo wrote:
> I did all your town councils, but my athentification system doesn't work.
> Here are my scripts:
>
> if(mysql_num_rows($result)!=0)
> {
>
> session_start();
> //global $HTTP_SESSION_VARS; (it doesn't
> influence in anything)
> $HTTP_SESSION_VARS['authentified']="YES";
> header("Location: page1.php");
> ...
Note the spelling of 'authentified'.
> And in the other file (page1.php):
>
> session_start();
> //global $HTTP_SESSION_VARS; (it doesn't influence in anything)
Declaring a variable as global has no meaning if you're not inside a function.
> if($HTTP_SESSION_VARS['autthentified']!="YES")
And note the spelling of 'autthentified'.
If you're unsure of what a variable contains always use print_r() or
var_dump() to find out.
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
Haste makes waste.
-- John Heywood
*/