#36092 [Opn->Bgs]: typing error

From: Date: Thu, 19 Jan 2006 22:07:22 +0000
Subject: #36092 [Opn->Bgs]: typing error
References: 1  Groups: php.doc 
Request: Send a blank email to phpdoc+get-969371651@lists.php.net to get a copy of this message
ID: 36092 Updated by: vrana@php.net Reported By: v dot matys at seznam dot cz -Status: Open +Status: Bogus Bug Type: Documentation problem Operating System: doc on php.net PHP Version: Irrelevant New Comment: I've fixed the example in DB, it will show on web after some time. However it's not a documentation bug but a problem in a user contributed note (thus I've marked this bug as bogus). Next time, please send a message to php-notes@lists.php.net or add your own note to provide alternative example. Previous Comments: ------------------------------------------------------------------------ [2006-01-19 20:54:01] v dot matys at seznam dot cz 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 this bug report at http://bugs.php.net/?id=36092&edit=1

« previous php.doc (#969371651) next »