예제 #1
0
	echo "上传文件不能大于2M";
	exit();
}
*/
/*
echo "<pre>";
print_r($_FILES);
echo "</pre>";
*/
/*
print_r($_FILES);
exit();
*/
//上传文件
//is_uploaded_file 判断是否通过 http 或 post 方式上传
$upload_img = new upload_img_class();
$name = $_POST['user'];
$content = $_POST['content'];
//print_r($_FILES);
//exit();
$res = $upload_img->upload_file($_FILES['upload']['tmp_name'], $name, $content, $_FILES['upload']['type'], $_FILES['upload']['size']);
if ($res == 0) {
    echo "没有上传文件";
    exit;
} else {
    if ($res == 2) {
        echo "只能上传jpg 或 jpeg文件";
        exit;
    } else {
        if ($res == 3) {
            echo "上传文件不能大于2M";
예제 #2
0
<?php

header("content-type:text/html;charset=utf-8");
require_once 'upload_img_class.php';
require_once 'fenye_class.php';
$upload_img = new upload_img_class();
$fenye_class = new fenye_class();
$arr = $upload_img->get_info();
if (!empty($_GET['pagenow'])) {
    $fenye_class->page_now = $_GET['pagenow'];
}
echo "<h1>图库管理界面</h1>";
/*
$str = substr($arr[0]['path'],strripos($arr[0]['path'],"/")+1);
echo $str;
exit();
*/
echo $upload_img->get_fenye($fenye_class);
for ($i = 0; $i < count($fenye_class->fenyu_arr); $i++) {
    echo "<table width='600px'>";
    $file_name = substr($fenye_class->fenyu_arr[$i]['path'], strripos($fenye_class->fenyu_arr[$i]['path'], "/") + 1);
    echo "<tr><td>文件名:</td> <td>{$file_name}</td></tr>";
    echo "<tr><td>截图:</td><td><img src='{$fenye_class->fenyu_arr[$i]['path']}' width='50px' height='50px'/></td></tr>";
    echo "<tr><td>上传人:</td><td>{$fenye_class->fenyu_arr[$i]['name']}</td></tr>";
    echo "<tr><td>文件信息:</td><td>{$fenye_class->fenyu_arr[$i]['message']}</td></tr>";
    echo "<tr><td>下载文件</td><td><a href='upload/{$fenye_class->fenyu_arr[$i]['name']}/{$file_name}'>下载该文件</a></td></tr>";
    echo "</table>";
    echo "<hr/>";
}
echo $fenye_class->navigator;