當前位置: 首頁>>代碼示例>>PHP>>正文


PHP factory::upload_factory方法代碼示例

本文整理匯總了PHP中factory::upload_factory方法的典型用法代碼示例。如果您正苦於以下問題:PHP factory::upload_factory方法的具體用法?PHP factory::upload_factory怎麽用?PHP factory::upload_factory使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在factory的用法示例。


在下文中一共展示了factory::upload_factory方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: nl2br

 $text = $_POST['text'];
 $filename = $_FILES['img']['name'];
 $rozmiar0 = $_FILES['img']['size'];
 $rodzaj = $_FILES['img']['type'];
 try {
     if ($title != null && $text != null && $filename != null && $rozmiar0 != null) {
         $file_info = upload::getInfo($title, $rozmiar0, $rodzaj, $text);
         //Title
         echo nl2br($file_info[0]);
         //Size in MB
         echo nl2br($file_info[1]);
         //Description
         echo nl2br($file_info[3]);
         //Type of image
         echo nl2br($file_info[2]);
         $object = factory::upload_factory();
         $object->sprawdz_bledy($_FILES['img']['error']);
         $check = $object->sprawdz_typ($filename);
         $file_extension = upload::getExtension($filename);
         try {
             if ($check) {
                 $final_filename = rand();
                 $final_filename .= "_";
                 $final_filename .= $filename;
                 @($zapisz = $object->saveImage($final_filename));
                 //  $file_name.=".";
                 //  $file_name.=$file_extension;
                 if ($zapisz) {
                     echo "<h1 class=\"grey text-center\">Zapisano obrazek do oczekujących</h1>";
                     echo '<div class="post-border well well-lg " style="background-color:rgba(16,16,16,0.95);border:15px solid #272727;">' . '<li style="list-style-type:none;text-align:center;font-weight:bold;color:white;">' . $title;
                     echo "<img src=\"uploaded_images/{$filename}\" class=\"img-responsive\">";
開發者ID:CodeEmperor,項目名稱:inba,代碼行數:31,代碼來源:upload.php

示例2: ob_start

<?php

ob_start();
require_once 'loader.php';
/*
 * This site was created to operate on rating in website. It saves a votes form users to database.
 */
try {
    if (isset($_GET['rate']) && $_GET['rate'] != null) {
        $rating = factory::upload_factory();
        $rating->rating($_GET['rate'], $_GET['id']);
        echo '<h1 class="text-center grey">Głos został oddany!</h1>';
    }
} catch (Exception $e) {
    echo '<h1 class="text-center grey">' . $e->getMessage() . '</h1>';
    if (isset($_GET['site'])) {
        header("refresh:1;url=http://projects.e-kei.pl/inba/index.php?site=" . $_GET['site'] . "");
    } else {
        if (isset($_GET['id'])) {
            header("refresh:1;url=http://projects.e-kei.pl/inba/index.php?is=" . $_GET['id'] . "");
        }
    }
}
if (!isset($e)) {
    if (isset($_GET['site'])) {
        header("refresh:1;url=http://projects.e-kei.pl/inba/index.php?site=" . $_GET['site'] . "");
    } else {
        if (isset($_GET['id'])) {
            header("refresh:1;url=http://projects.e-kei.pl/inba/index.php?ids=" . $_GET['id'] . "");
        }
    }
開發者ID:CodeEmperor,項目名稱:inba,代碼行數:31,代碼來源:rating.php


注:本文中的factory::upload_factory方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。