Learning PHP and MySQL

Example 13-11 Registering a variable with session_register

<?php
//DON'T  USE  THIS  APPROACH session_start(); session_register("hello");
$hello  =  "Hello  World";
?>

Modern PHP interpreters return a warning with this code:

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  enabledYou  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

Posted by on 09/25 at 11:33 AM

Next entry: Example 13-12 Registering a variable by including it in $_SESSION

Previous entry: Example 13-10 Simply starting a session

<< Back to main