Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
i'm trying to upload multiple files using arrays..which works fine..but i'm specifically trying to define a variable based on the number of the array.
here's my code to see what i mean:Code: Select all
if ($_POST['action'] == 'editmultiple')
$files = array();
foreach ($_FILES['photosnews'] as $k => $l) {
foreach ($l as $i => $v) {
if (!array_key_exists($i, $files))
$files[$i] = array();
$files[$i][$k] = $v;
##### THIS IS WHERE I'M HAVING TROUBLE ####
if ($_FILES['photosnews'] == 1) {
$vartest = "this is one";
} else {
$vartest = "this is not one";
}
#################################
}
}here's part of the form too if needed:
Code: Select all
<input name="photosnews[]" type="file" class="input" size="10" accept="image/gif, image/jpeg, image/jpg" >
<input type="hidden" name="action" value="editmultiple" />-matt
Jcart | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]