From: v dot matys at seznam dot cz
Operating system: doc on php.net
PHP version: Irrelevant
PHP Bug Type: Documentation problem
Bug description: typing error
Description:
------------
manual/en/language.variables.external.php#54634
line:
$this = unserialize($_SESSION['vars_serialized']);
should contain "xvars_..." not "vars_..."
I suggest my simplest version of that script:
<?php
if(!Array_Key_Exists('xvars_serialized',$_SESSION)) {
$_SESSION['xvars_serialized']=""; echo "tudy\n";}
if(!$_SESSION['xvars_serialized']) {
// If data has just been recieved, it is saved in $this and the
current URL is builded.
foreach ($_GET as $key => $value) $pa[$key] = $value;
foreach($_POST as $key => $value) $pa[$key] = $value;
$pa['doc_url'] = 'http://' .$_SERVER['HTTP_HOST']
.$_SERVER['PHP_SELF'] .'?' .$_SERVER['argv'][0];
// If no POST data is recieved, nothing more is to be done. If POST
data is recieved it is serialized to session and the page is redirected to
itself with GET data but without POST data.
if($_POST) {
$_SESSION['xvars_serialized'] = serialize($pa);
header('Location: ' .$pa['doc_url']);
exit();
}
}
// Just after the above redirecting, GET and POST data is unserialized
into the object.
else {
$_POST = unserialize($_SESSION['xvars_serialized']);
$_SESSION['xvars_serialized'] = "";
}
?>
Viktor
--
Edit bug report at http://bugs.php.net/?id=36092&edit=1
--
Try a CVS snapshot (PHP 4.4):
http://bugs.php.net/fix.php?id=36092&r=trysnapshot44
Try a CVS snapshot (PHP 5.1):
http://bugs.php.net/fix.php?id=36092&r=trysnapshot51
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=36092&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=36092&r=fixedcvs
Fixed in release:
http://bugs.php.net/fix.php?id=36092&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=36092&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=36092&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=36092&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=36092&r=support
Expected behavior: http://bugs.php.net/fix.php?id=36092&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=36092&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=36092&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=36092&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=36092&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=36092&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=36092&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=36092&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=36092&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=36092&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=36092&r=mysqlcfg