Re: $_FILES help!
| From: | Tom Rogers | Date: | Tue, 27 May 2003 12:35:14 +0000 |
| Subject: | Re: $_FILES help! | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-149099@lists.php.net to get a copy of this message | ||
Hi,
Tuesday, May 27, 2003, 10:17:21 PM, you wrote:
AJR> Can someone please tell me what I'm doing wrong? The following code snippet
AJR> works fine after uploading a file (value="myfile")
AJR> <? foreach($_FILES as $key => $val) {
AJR> echo "$key :<br>";
AJR> foreach ($val as $key2 => $val2) {
AJR> echo " $key2:
AJR> $val2<br>";
AJR> }
AJR> }
?>>
AJR> and gives the output:
AJR> myfile :
AJR> name: doc++-3.4.9.zip
AJR> type:
AJR> tmp_name:
AJR> error: 2
AJR> size: 0
AJR> But doing the following:
AJR> <? echo "$_FILES["myfile"]["error"]";?>
AJR> Gives the message:
AJR> Parse error: parse error, expecting
T_STRING' or
AJR> T_VARIABLE' or
AJR> `T_NUM_STRING' in /home/adam/public_html/php/uploadproc.php on line 7
AJR> Can someone tell me why this isn't working? I'm going nuts with this!
AJR> Thanks in advance.
AJR> Adam
You don't need the quotes
<? echo $_FILES["myfile"]["error"]?>
--
regards,
Tom