RE: [PHP] [NEWBIE] Trying to create a function from an existing script

From: Date: Thu, 27 Jan 2005 15:36:19 +0000
Subject: RE: [PHP] [NEWBIE] Trying to create a function from an existing script
Groups: php.general 
Request: Send a blank email to php-general+get-207488@lists.php.net to get a copy of this message
From: Dave [mailto:dave@tokyocomedy.com] > The Problem: > I'm not able to create the right syntax to pass the > $HTTP_POST_FILES variable to the function. So the function > gets called, but then it stops very early because what I > end up giving it is essentially an empty array, so it > thinks there's no file to handle. $HTTP_POST_FILES isn't an auto-global. As such, your function is looking for a localized variable called $HTTP_POST_FILES and finds nothing. Add the following as the first line of your function, and it should work fine: global $HTTP_POST_FILES; See here for more info: http://us3.php.net/manual/en/reserved.variables.php#reserved.variables.f iles Hope this helps! -- Mike Johnson Smarter Living, Inc. Web Developer www.smartertravel.com mike@smarterliving.com (617) 886-5539

« previous php.general (#207488) next »