本文整理汇总了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\">";
示例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'] . "");
}
}