Weird sessions problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I have a routine that uses sessions vars to hold the details of the previous
page, so I can bounce back to it if necessary. But I'm having some weird
problems with it. In the page I have the following (line numbers included
to get you an idea of where these things come):

17. require_once(INC_PATH."i_std_cfg.phtml");

(this include file includes the following:)

define('THIS_PAGE',$_SERVER['PHP_SELF']);
function get_ref_page() {
  /* Retrieves the details of the last page which will have set
     the session vars referred to */
  $ref_page = array();
  if(isset($_SESSION['ref_page'])) {
    $ref_page['name'] = $_SESSION['ref_page'];
    if(isset($_SESSION['ref_pagequery'])) {
      $ref_page['query'] = $_SESSION['ref_pagequery'];
    }
  }
return $ref_page;
}

Now back in the main page:

53. $ref_page = get_ref_page(); // now reset session vars to current page
54. $_SESSION['ref_page'] = THIS_PAGE;
55. $_SESSION['ref_pagequery'] = $_SERVER['QUERY_STRING'];

Now, on my local system (PHP 4.3.4) this all works fine. On the live system
(PHP 4.1 - with PHP run, I believe, as CGI module) I hit a problem. At line
53, $ref_page is an array containing the values I expect. After line 54,
$ref_page is now a scalar containing the value of THIS_PAGE. It's almost as
though line 54 has been executed before line 53... Help!

-- 
@+
Steve

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux