当前位置: 首页>>代码示例>>PHP>>正文


PHP Gallery::newGalleryImage方法代码示例

本文整理汇总了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">
开发者ID:kblestarge,项目名称:dight350,代码行数:30,代码来源:gallery.php

示例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":
开发者ID:michaeljmatthews22,项目名称:dightHum,代码行数:31,代码来源:index.php


注:本文中的Gallery::newGalleryImage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。