本文整理匯總了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":