Re: About the $allowed problem
| From: | Andrey Hristov | Date: | Tue, 28 Aug 2001 10:16:55 +0000 |
| Subject: | Re: About the $allowed problem | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-64751@lists.php.net to get a copy of this message | ||
var_dump before session_start won't work because session_start() uses internally header().
The idea is that there is no use of $allowed before session_start(). The name is session_start, so
it has to be the first statement
in the script or the first after include-s/require-s. As I said it is good practice to use
$SESSION_VARS array, or $HTTP_GET_VARS
$HTTP_POST_VARS for session/get/post variables
Andrey Hristov
IcyGEN Corporation
http://www.icygen.com
99%
----- Original Message -----
From: "Antonio S. Martins Jr." <shadow@wnet.com.br>
To: "Andrey Hristov" <ahristov@icygen.com>
Cc: <php-general@lists.php.net>
Sent: Monday, August 27, 2001 10:42 PM
Subject: Re: [PHP] About the $allowed problem
> On Mon, 27 Aug 2001, Andrey Hristov wrote:
>
> > <?php
> > session_start();
> > if (!session_is_registered("allowed")){
> > $allowed=3306;
> > session_register("allowed");
> > }
> > var_dump($allowed);
> > ?>
> >
> > called with :
> > http://192.168.1.11/test2.php?allowed=5000
> >
> > returns :
> > int(3306)
>
> Ok,
> remeber, on the first run the var isn't registered, then you set it to
> "3306", on the subsequents calls it restore the value on the
> "session_start();" then the value "3306" will replace the "5000".
> Try
> puting the "var_dump" before the "session_start", or try testing
> "$HTTP_GET_VARS[allowed]" .
>
> Antonio.
>
> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
> | Antonio S. Martins Jr. - System Analist | "Only The Shadow Knows |
> | WorldNet Internet Maringa - PR - Brasil | what evil lurks in the |
> | E-Mail: shadow@wnet.com.br | Heart of Men!" |
> | shadow@uem.br | !!! Linux User: 52392 !!! |
> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
> This e-mail message is 100% Microsoft free!
>
> /"\
> \ / CAMPANHA DA FITA ASCII - CONTRA MAIL HTML
> X ASCII RIBBON CAMPAIGN - AGAINST HTML MAIL
> / \
>
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>