Re: Warning message... Any ideas?
| From: | Seairth Jacobs | Date: | Mon, 21 Apr 2003 17:55:19 +0000 |
| Subject: | Re: Warning message... Any ideas? | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-19536@lists.php.net to get a copy of this message | ||
PHP thinks you are trying to treat $kat_menu as a session variable and is
warning you that it won't work that way unless you use register_globals.
Try using different variable names than you are using in your session array.
At least that's my understanding of what it's saying (though it's a bit
cryptic about it). Of course, I could be wrong also. :)
---
Seairth Jacobs
seairth@seairth.com
"Bobo Wieland" <bobo.wieland@ektv.nu> wrote in message
news:000e01c307d7$3d0ef7a0$14f21e0a@elstudion...
> "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 I'm trying to do is check the session variables - and if they're not
> set I redirects the page to the index page...
>
> My code:
>
> <?php
> session_start();
> error_reporting(E_ALL);
> ?>
> <?xml version='1.0' encoding='iso-8859-1' ?>
> <!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.1 Transitional//SV'
>
> 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>
> <html xmlns='http://www.w3.org/1999/xhtml'
> xml:lang='SV' lang='SV'>
> <?php
> (isset($_SESSION["kat_menu"])) ? ($kat_menu =& $_SESSION["kat_menu"])
> :
> ($kat_menu = false);
> (isset($_SESSION["menu"])) ? ($menu =& $_SESSION["menu"]) : ($menu =
> false);
> $items_total =& $_SESSION["items_total"];
>
> $id = $_GET["id"];
> $isquestion = (bool) $_GET["isquestion"];
>
> if ($kat_menu == false || $menu == false) {
> if ($isquestion == true) {
> echo("<body
>
onload=\"javascript:void(location.href='index.php?id=".$id."')\"></body></ht
> ml>");
> die();
> }
> else {
> echo("<body
>
> onload=\"javascript:void(location.href='index.php')\"></body></html>");
> die();
> }
> }
> ?>
>