本文整理汇总了PHP中Photograph::upload_images方法的典型用法代码示例。如果您正苦于以下问题:PHP Photograph::upload_images方法的具体用法?PHP Photograph::upload_images怎么用?PHP Photograph::upload_images使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Photograph
的用法示例。
在下文中一共展示了Photograph::upload_images方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: count
$hotel->info = $_POST['info'];
if ($hotel->update()) {
redirect_to("page.php?id={$hotel->id}");
}
} else {
$message = "You have to fill all the fields";
}
}
if (isset($_POST['submit'])) {
if (isset($_FILES['slika'])) {
$num = count($_FILES['slika']['name']);
for ($i = 0; $i < $num; $i++) {
$photo = new Photograph();
$photo->hotel_id = $hotel->id;
if ($_FILES['slika']['error'][$i] == 0) {
if ($photo->upload_images($_FILES['slika']['name'][$i], $_FILES['slika']['tmp_name'][$i], $_FILES['slika']['type'][$i], $_FILES['slika']['size'][$i])) {
$message = "Photographs successfully uploaded";
} else {
$message = join('<br>', $photo->errors);
}
} else {
$message = "Can't upload <b>" . $_FILES['slika']['name'][$i] . "</b><br/>";
}
}
}
}
?>
<!DOCTYPE html>
<html>
<head>
<title></title>