Re: problem with "count" function ...

From: Date: Tue, 06 May 2003 19:31:58 +0000
Subject: Re: problem with "count" function ...
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-146552@lists.php.net to get a copy of this message
On Wednesday 07 May 2003 03:11, Kenn Murrah wrote: > I'm sure I'm overlooking something simple, but I just can't see it ... I remember someone having the same problem way back. > I'm trying to upload multiple files via PHP, having built a forms page > with 10 > > <input type=file name='userFile'> > > statements ... and I'm trying to determine how many times to process my > upload handling loop with > > for ($i=0; $i<count($_FILES['userFile']); $i++) > > but no matter how many files I try to upload, I get a count of 4 ... > what am I doing wrong? **CLUE** print_r($_FILES['userFile']) And I'm sure you'll see what you're doing wrong. You need to give each upload a different name. Eg 'userFile1', 'userFile2' etc, or userFile[], or userFile[1], userFile[2] etc -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * ------------------------------------------ Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general ------------------------------------------ /* Traffic jam on the Information Superhighway. */

« previous php.general (#146552) next »