That did it! Thanks.

On Wednesday, January 8, 2003, at 05:16 AM, Ford, Mike [LSS] wrote:

-----Original Message-----
From: Mike Tuller [mailto:[EMAIL PROTECTED]]
Sent: 08 January 2003 01:23

I am working with sessions, and following an example in a book and am
getting an error that I am not sure of. I have an html doc
that has the
fields for username and password and the information entered goes to
this script.

<?
session_start();
[...]
	if ($num > 0 )
	{
		$valid_user = $_POST[username];
		session_register("valid_user");
	}

// PHP script to create the html for the login page
if (session_is_registered("valid_user"))
[...]
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

What does this mean, and what am I doing wrong?
Well, you're not necessarily doing anything wrong -- as the warning says, your script *possibly* relies on...

What's happened is that in version 4.3.0, a bug in session variable handling was fixed -- but the fix changes the way session variables behave in certain situations, and PHP has detected that you *may* have coded in a way that is sensitive to those changes. If you understand the issues (and I'm not 100% sure I do!) and are *sure* you're not relying on them, then you can set the session.bug_compat_* values in php.ini as specified.

The best way of avoiding this error, however, is to drop the use of session_register() and friends, and switch to using the $_SESSION[] array -- so the fragment of code I've left in above would become:

if ($num > 0 )
{
$_SESSION['valid_user'] = $_POST['username'];
}

// PHP script to create the html for the login page
if (isset($_SESSION["valid_user"]))

Cheers!

Mike

---------------------------------------------------------------------
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS, LS6 3QS, United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211


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

Reply via email to