本文整理汇总了PHP中Gallery::newGalleryImage方法的典型用法代码示例。如果您正苦于以下问题:PHP Gallery::newGalleryImage方法的具体用法?PHP Gallery::newGalleryImage怎么用?PHP Gallery::newGalleryImage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gallery
的用法示例。
在下文中一共展示了Gallery::newGalleryImage方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: explode
echo $imageFileType . "<br>";
#$something = $_FILES["image"]["tmp_name"];
#echo $something . "<br>";
#echo "got here!2222222222<br>";
$fileName = $_FILES["image"]["name"];
echo "got here!br>";
#$fileArray = explode(".",$fileName);
#$extension = $fileArray[1];
$extensionType = "image/" . $imageFileType;
echo $extensionType . "<br>";
if ($extensionType == "image/jpg" or "image/JPG") {
$extensionType = "image/jpeg";
}
if ($Gallery->filetypeCheck($extensionType)) {
echo "True";
$Gallery->newGalleryImage($_FILES["image"], $_POST["caption"]);
} else {
echo "<p class='bg-danger'>Something is wrong with your upload...</p>";
}
}
?>
<!DOCTYPE html>
<html>
<head>
<title>Gallery Display</title>
<link rel="stylesheet" type="text/css" href="style.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
</head>
<body id="main">
示例2: header
<?php
# Making sure that we bring in our Gallery class
require "class.Gallery.php";
# Checking to see if the form was completed and a file was selected
if (!empty($_POST) && !empty($_FILES)) {
# Check for a valid file type
if (Gallery::filetypeCheck($_FILES["uploadImage"]["type"])) {
# Upload the image and indicate success
Gallery::newGalleryImage($_FILES["uploadImage"]);
$status = "success";
} else {
# Bad file type or other failure
$status = "failure";
}
# Redirect to same page; trigger page refresh
header("location: index.php?status={$status}");
}
?>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="gallery.css">
<title>Simple Gallery</title>
</head>
<body>
<div class="clearfix">
<?php
switch ($_GET["status"]) {
case "success":