note 52857 added to language.variables.predefined

From: Date: Sun, 15 May 2005 12:08:25 +0000
Subject: note 52857 added to language.variables.predefined
Groups: php.notes 
Request: Send a blank email to php-notes+get-89448@lists.php.net to get a copy of this message
To urbanheroes: version_compare() is only in PHP version 4.1.0 and up. This completely negates your function, since if the version is less than 4.1.0 it will generate an error anyway. The better solution is to do what is stated in the post above yours: <?php if (!isset($_SERVER)) { $_GET = &$HTTP_GET_VARS; $_POST = &$HTTP_POST_VARS; $_ENV = &$HTTP_ENV_VARS; $_SERVER = &$HTTP_SERVER_VARS; $_COOKIE = &$HTTP_COOKIE_VARS; $_REQUEST = array_merge($_GET, $_POST, $_COOKIE); } ?> Include that before everything else in your script and it will fix the flaw. ---- Manual Page -- http://www.php.net/manual/en/language.variables.predefined.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+52857 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+52857&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+52857&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+52857&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+52857&report=yes&reason=useless Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+52857&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+52857&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#89448) next »