Re: [PHP] register_globals and sessions

2009-11-26 Thread Brady Mitchell
On Wed, Nov 25, 2009 at 3:01 PM, Allen McCabe allenmcc...@gmail.com wrote:
 *Warning*: Unknown: Your script possibly relies on a session side-effect
 which existed until PHP 4.2.3. Please be advised that the session extension
 does not consider global variables as a source of data, unless
 register_globals is enabled. You can disable this functionality and this
 warning by setting session.bug_compat_42 or session.bug_compat_warn to off,
 respectively in *Unknown* on line *0*

It sounds like you're trying to use $_SESSION without having a
session_start() call first.

 I have Googled this extensively, and the solutions other people tried
 (turning off the warning) don't work for me; I don't have permission to my
 PHP settings (currently working on a free-hosted site).

There are many settings that can be changed using the function ini_set
(http://php.net/ini_set) and display_errors is one of them.
That said, it is always best to fix stuff like this than just hiding
it. When you just hide errors/warnings/notices things don't always
work reliably.

HTH,

Brady

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] register_globals and sessions

2009-11-25 Thread Allen McCabe
LPAC - Arts for Youth - Seat OrdersI am getting the following error message,
but ONLY on a page where I am querying multiple tables, and I don't see the
correlation:

*
*
*Warning*: Unknown: Your script possibly relies on a session side-effect
which existed until PHP 4.2.3. Please be advised that the session extension
does not consider global variables as a source of data, unless
register_globals is enabled. You can disable this functionality and this
warning by setting session.bug_compat_42 or session.bug_compat_warn to off,
respectively in *Unknown* on line *0*

I have Googled this extensively, and the solutions other people tried
(turning off the warning) don't work for me; I don't have permission to my
PHP settings (currently working on a free-hosted site).

Does ANYONE know what might be causing this?

On my login page, I use this code snippet to instantiate my SESSION
variables for the session:

// Register $myusername, $mypassword and redirect to default.php?page=211
$_SESSION['myusername'] = $myusername;
$_SESSION['mypassword'] = $mypassword;

Again, the error only comes up on the page where I am querying multiple.

If you would like to take a look at this, follow this link and sign in as
username: micky   password: 123456 (
http://lpacmarketing.hostzi.com/afy/orders/)

You will notice on other pages, that error doesn't display, just this one.

Any help would be wonderful, I don't want my users to see this when the
order system is opened for their use.

Thanks!