note 15082 added to language.variables.php

From: Date: Mon, 27 Aug 2001 15:40:18 +0000
Subject: note 15082 added to language.variables.php
Groups: php.notes 
Request: Send a blank email to php-notes+get-17212@lists.php.net to get a copy of this message
PROBLEM: environment variable HTTP_POST_VARS undefined (Since many people with this problem will probably search THIS place, I'll put this snippet here.) SOLUTION: When you're inside a function, don't forget to declare $HTTP_POST_VARS or imported form identifiers as GLOBALS, because otherwise you won't REACH them from inside the function. Instead, PHP will always state: 'Undefined variable ...'. (I was nearly desperating after 2 days with this stupid problem.) Use: function xy() { global $HTTP_POST_VARS; ... and things will be ok. Regards, Daniel http://www.php.net/manual/en/language.variables.php

« previous php.notes (#17212) next »