RE: [PHP] Combining Variables
| From: | Jason Soza | Date: | Wed, 24 Apr 2002 06:50:52 +0000 |
| Subject: | RE: [PHP] Combining Variables | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-94312@lists.php.net to get a copy of this message | ||
Well that was embarrassing. I guess [CTRL]+[ENTER] sends mail in Outlook!
Let's try that again:
Okay, I think this is an easy thing but I can't figure it out:
I have a script that will be uploading (up to) 4 files:
$file1
$file2
$file3
$file4
Each $file variable has associated $original_name, $filesize, and $filename
variables. Each file:
$original_name = $HTTP_POST_FILES['userfile1']['name'];
that gets uploaded needs to 1) have the filename modified:
$filename1 = ereg_replace("[^a-z0-9._]", "",
ereg_replace (" ", "_",
ereg_replace("%20", "_",
strtolower($orig_name))));
2) the extension compared to a list of 'forbidden' extensions,
3) the filename compared to filenames already in existence in the upload
directory,
and 4) uploaded.
Can I do this without writing separate filename, extension, existing, and
uploading scripts? Can someone point me in the right direction here?
Thanks,
Jason Soza