[thelist] OO PHP

Allie Micka allie at pajunas.com
Tue Feb 12 19:11:11 CST 2002


> I want a function in the object to check to see if a file has been
> uploaded. To do this, I wanted the object to check $HTTP_POST_FILES on
> its own. If I do this, I get this error/warning:
>
> Warning: Undefined variable: HTTP_POST_FILES

In your function, or wherever you're checking the $HTTP_POST_FILES variable,
use

if(isset($HTTP_POST_FILES) && $HTTP_POST_FILES[name][size])     {
	echo 'you uploaded a file!';
}

or whatever you want for that second conditional.  the key is isset.   I
agree that $_FILES is a much handier way to go though.

Allie Micka
pajunas interactive, inc.
http://pajunas.com




More information about the thelist mailing list