RE: [PHP] Uploading files
| From: | scott [gts] | Date: | Mon, 02 Jul 2001 16:17:15 +0000 |
| Subject: | RE: [PHP] Uploading files | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-55860@lists.php.net to get a copy of this message | ||
use assoc. arrays, please. your code will be *much*
easier to maintain and extend. variables-of-variables
are headaches for everyone involved.
$location = $input_form[$i];
> -----Original Message-----
> From: David A Castillo [mailto:outpost7@hotmail.com]
> Sent: Friday, June 29, 2001 1:41 PM
> To: php-general@lists.php.net
> Subject: [PHP] Uploading files
>
>
> Okay, I'm absolutely certain that there's a simple solution to my problem,
> but my forehead is getting sore from banging it against the wall, so I
> thought I'd pick y'all's brains.
>
> I'm using a form to upload a number of files named $input_form_$i where $i
> is from 0 to 5 and the following is my code:
>
> for ($i = 0; $i<=5; $i++){
>
> $l = "input_form_$i";
> $location = $$l;
>
> move_uploaded_file($location, "$upload_path/$location_name");
>
> }
> with that, I get the following warnings:
>
> Warning: Unable to create '/': Invalid argument in [php file running
> program] on line 64
>
> Warning: Unable to move '/var/tmp//php9Uai9S' to '/' in [php file running
> program] on line 64
> /var/tmp//php9Uai9S not loadable
>
> Funny thing is another page that doesn't use the $$l method to dynamically
> grab variable names (just uses a static variable name) works totally fine
> with essentially the same code.
>
> FYI: The form type is "multipart/form-data" and the input fields are set to
> "file" so I have no idea what's going wrong. Any thoughts?
>
> David Castillo
> Application Systems Analyst
> Human Resources Department
> Northern Arizona University
> outpost7@hotmail.com
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>