Re: Problems with predefined variables
| From: | Tom�s Liendo | Date: | Fri, 16 May 2003 13:37:03 +0000 |
| Subject: | Re: Problems with predefined variables | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-147886@lists.php.net to get a copy of this message | ||
Quotes isn't the problem, this error doesn't exists in the real script (I'm
sorry). Is necessary to declare $HTTP_SESSION_VARS? I understood that it is
a predefinied variable, then always was available in any script.
"Bobby Patel" <anup_patel@rogers.com> escribió en el mensaje
news:20030516044122.56266.qmail@pb1.pair.com...
> quickly looking at your code, it seems you are not using the right index
of
> the array instead of this:
>
> if($HTTP_SESSION_VARS[authenticated]!="YES")
> try this
> if($HTTP_SESSION_VARS['authenticated']!="YES")
> notice the quotes.
>
> Also, if used inside a function make sure you declare the session array as
> global.
>
>
>
> "TomáS Liendo" <tomasjliendo@hotmail.com> wrote in message
> news:20030515225603.48258.qmail@pb1.pair.com...
> > Hi people I need help please. I'm making an authentification system with
> > PHP/MySQL. I did the following:
> >
> > ...
> > if(mysql_num_rows($result)!=0)
> > {
> > session_start();
> >
$HTTP_SESSION_VARS['authenticated']="YES";
> > ...
> >
> > And in the protected page:
> > ...
> > session_start();
> > if($HTTP_SESSION_VARS[authenticated]!="YES")
> > {
> > echo "Not valid user.<br>";
> > }
> > else
> > {
> > ...
> >
> > I always receipt the message "Not valid user". I was testing other
> > predefined variables and doesn't work. Then, my question is: Does it
exist
> > some form or configuration to activate or to disable the predefined
> > variables? Or simply I'm making an error with my authentication system?
> >
> > Ahead of time, thank you very much,
> >
> > Tom.
> >
> >
>
>