|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-01-19 23:07 UTC] vrana@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Nov 20 15:00:01 2025 UTC |
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