if(is_uploaded_file($_FILES["photosimg"]["tmp_name"]))
{
move_uploaded_file($_FILES["photosimg"]["tmp_name"], "../img/pages/photos/".$_FILES["photosimg"]["name"]);
$data = $_POST;
$nouser->photosimg = "img/pages/photos/".$_FILES["photosimg"]["name"];
R::store($nouser);
} else {
echo("Ошибка загрузки файла");
}
<input name="photosimg[]" type="file"/>
$_FILES["photosimg"]["tmp_name"][0]
будет первым из спискаforeach($_FILES as $file){....
foreach($_FILES as $file){
move_uploaded_file($_FILES["photosimg"]["tmp_name"][$file], "../img/pages/photos/".$_FILES["photosimg"]["name"]);
$data = $_POST;
$nouser->photosimg = "img/pages/photos/".$_FILES["photosimg"]["name"];
R::store($nouser);
}
foreach($_FILES as $file){
move_uploaded_file($file["photosimg"]["tmp_name"] "../img/pages/photos/".$file["photosimg"]["name"]);
$data = $_POST;
$nouser->photosimg = "img/pages/photos/".$file["photosimg"]["name"];
R::store($nouser);
}
$data = $_POST;- это про что?
<form action="up.php" method="post" enctype="multipart/form-data">
<input type="file" name='file[]' multiple />
<input type="submit"/>
</form>
<?php
foreach($_FILES as $file){
var_dump($file);echo '<br/>';
}
die('end');
?>
<form method="POST" action="admin.php" enctype="multipart/form-data">
<span>фото:</span>
<input type="file" name="photosimg[]" multiple required>
<button name="newpagebutton">Создать страницу</button>
</form>
foreach($_FILES as $file){
move_uploaded_file($file["photosimg"]["tmp_name"] "../img/pages/photos/".$file["photosimg"]["name"]);
$data = $_POST;
$nouser->photosimg = "img/pages/photos/".$file["photosimg"]["name"];
R::store($nouser);
}
<form action="up.php" method="post" enctype="multipart/form-data">
<input type="file" name='file[]' multiple />
<input type="submit"/>
</form>
<?php
foreach($_FILES as $file){
var_dump($file);echo '<br/>';
}
die('end');
?>
не работает