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


PHP checkUpload函数代码示例

本文整理汇总了PHP中checkUpload函数的典型用法代码示例。如果您正苦于以下问题:PHP checkUpload函数的具体用法?PHP checkUpload怎么用?PHP checkUpload使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了checkUpload函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: addData

function addData($name, $image)
{
    // include("db.php");
    $image = checkUpload();
    print $image;
    // $sql = "INSERT INTO images VALUES('$name', '$image')";
    // $result = mysql_query($sql) or die (mysql_error());
    print "Ready to add data";
    echo "<img src='http://images.jeffreyeverhart.com/images/" . $image . "'/>";
}
开发者ID:JEverhart383,项目名称:PHP-images,代码行数:10,代码来源:functions.php

示例2: getRecord

 } else {
     $codeParent = $parentId['parent'];
     $CodeModule = getRecord($tableCategoryConfigId, " id=" . $parentId['parent']);
 }
 $code_frame = $CodeModule['code'];
 $code_module = $CodeModule['code_module'];
 //echo $_POST['txtcodeParentCha'];
 //exit();
 $email = isset($_POST['txtEmail']) ? trim($_POST['txtEmail']) : '';
 $code = isset($_POST['txtCode']) ? trim($_POST['txtCode']) : '';
 $page1 = isset($_POST['page']) ? trim($_POST['page']) : '';
 $colorI = isset($_POST['radioColor']) ? trim($_POST['radioColor']) : '';
 $type_tab = isset($_POST['radioType_tab']) ? trim($_POST['radioType_tab']) : '0';
 $errMsg .= checkUpload($_FILES["txtThumbnail"], ".jpg;.gif;.bmp;.png", 500000 * 1024, 0);
 $errMsg .= checkUpload($_FILES["txtImage"], ".jpg;.gif;.bmp;.png;.mp4;.mp3;.flv", 500000 * 1024, 0);
 $errMsg .= checkUpload($_FILES["txtImageLarge"], ".jpg;.gif;.bmp;.png;.mp4;.mp3;.flv", 500000 * 1024, 0);
 $ldate = @strtotime(date("d-m-Y-g:i a"));
 $id_computer = getRealIpAddr();
 if ($name == "") {
     $errMsg .= CNAME . "<br>";
 }
 if ($errMsg == '') {
     if (!empty($_POST['id'])) {
         $oldid = $_POST['id'];
         /*---------------------------UPDATE*/
         /*---------------------------UPDATE TIN*/
         $fields_arr1 = array("id_parent" => "{$id_parent}", "type_tab" => "{$type_tab}", "code" => "'{$code}'", "typeivm" => "{$typeIVM}", "code_frame" => "'{$code_frame}'", "code_module" => "'{$code_module}'", "id_computer" => "'{$id_computer}'", "name" => "'{$name}'", "email" => "'{$email}'", "ldate" => "'{$ldate}'", "last_modified" => "now()");
         $result = update($tableTabId, $fields_arr1, "id=" . $oldid);
         foreach ($conf as $ln => $j) {
             $name = isset($_POST['txtName' . $ln]) ? trim($_POST['txtName' . $ln]) : '';
             $defaulUrlLn = trim($_POST['txtUrl' . $ln]);
开发者ID:bestwishforyou95,项目名称:congnghemoitruong,代码行数:31,代码来源:tab_m.php

示例3: isset

 $colorI = isset($_POST['radioColor']) ? trim($_POST['radioColor']) : '0';
 $commonI = isset($_POST['commonDefault']) ? trim($_POST['commonDefault']) : '0';
 $kg = isset($_POST['txtKg']) ? trim($_POST['txtKg']) : '0';
 $link = isset($_POST['txtLink']) ? trim($_POST['txtLink']) : '';
 if ($defaulType['type_price'] == '1') {
     //kiem tra gia
     $price = isset($_POST['txtPrice']) ? trim($_POST['txtPrice']) : '';
     $sale = isset($_POST['txtSale']) ? trim($_POST['txtSale']) : '';
     $oldprice = isset($_POST['txtOldprice']) ? trim($_POST['txtOldprice']) : '';
 }
 $id = isset($_POST['id']) ? trim($_POST['id']) : '';
 $page1 = isset($_POST['page']) ? trim($_POST['page']) : '';
 $home = $_POST['chkHome'] != '' ? 1 : 0;
 $errMsg .= checkUpload($_FILES["txtThumbnail"], ".jpg;.gif;.bmp;.png;.swf", 500 * 1000024, 0);
 $errMsg .= checkUpload($_FILES["txtImage"], ".jpg;.gif;.bmp;.png;.swf", 500 * 1000024, 0);
 $errMsg .= checkUpload($_FILES["txtImageLarge"], ".jpg;.gif;.bmp;.png;.swf", 500 * 1000024, 0);
 $ldate = @strtotime(date("d-m-Y-g:i a"));
 $lang = isset($_POST['lang']) ? trim($_POST['lang']) : '';
 if ($name == "") {
     $errMsg .= CNAME . "<br>";
 }
 /*--------KIEM TRA MA DA TON TAI CHUA------------------------*/
 if ($id == '') {
     if (countRecord($tableConfigId, "code='{$code}'") > 0) {
         $errMsg .= CPLEASEENTERYOURCODE . " <br>";
     }
 } else {
     if (countRecord($tableConfigId, "code='" . $code . "' and id<>" . $id) > 0) {
         $errMsg .= CTHISCODEALREADY . " <br>";
     }
 }
开发者ID:bestwishforyou95,项目名称:congnghemoitruong,代码行数:31,代码来源:module_pro_m.php

示例4: logMessage

        if (loggingEnabled()) {
            logMessage('reached operations.php without $_POST or $_GET variables set', 'error');
            header('Location: index.php');
        }
    }
}
$operation = $_POST['operation'];
switch ($operation) {
    case 'create_upload_form':
        createUploadForm($_POST['videoTitle'], $_POST['videoDescription'], $_POST['videoCategory'], $_POST['videoTags']);
        break;
    case 'edit_meta_data':
        editVideoData($_POST['newVideoTitle'], $_POST['newVideoDescription'], $_POST['newVideoCategory'], $_POST['newVideoTags'], $_POST['videoId']);
        break;
    case 'check_upload_status':
        checkUpload($_POST['videoId']);
        break;
    case 'delete_video':
        deleteVideo($_POST['videoId']);
        break;
    case 'auth_sub_request':
        generateAuthSubRequestLink();
        break;
    case 'auth_sub_token_upgrade':
        updateAuthSubToken($_GET['token']);
        break;
    case 'clear_session_var':
        clearSessionVar($_POST['name']);
        break;
    case 'retrieve_playlists':
        retrievePlaylists();
开发者ID:holdensmagicalunicorn,项目名称:copperFramework,代码行数:31,代码来源:operations.php

示例5: isset

$errMsg = '';
$path = "../images/content";
$pathdb = "images/content";
if (isset($_POST['btnSave'])) {
    $code = isset($_POST['txtCode']) ? trim($_POST['txtCode']) : '';
    $name = isset($_POST['txtName']) ? trim($_POST['txtName']) : '';
    $parent = $_POST['ddCat'];
    $subject = isset($_POST['txtSubject']) ? trim($_POST['txtSubject']) : '';
    $detail_short = isset($_POST['txtDetailShort']) ? trim($_POST['txtDetailShort']) : '';
    $detail = isset($_POST['txtDetail']) ? trim($_POST['txtDetail']) : '';
    $sort = isset($_POST['txtSort']) ? trim($_POST['txtSort']) : 0;
    $status = $_POST['chkStatus'] != '' ? 1 : 0;
    $catInfo = getRecord($tableCategoryConfig, 'id=' . $parent);
    $lang = $catInfo['lang'];
    $errMsg .= checkUpload($_FILES["txtImage"], ".jpg;.gif;.bmp;.jpeg;.png", 1024 * 1024, 0);
    $errMsg .= checkUpload($_FILES["txtImageLarge"], ".jpg;.gif;.bmp;.jpeg;.png", 1024 * 1024, 0);
    if ($errMsg == '') {
        if (!empty($_POST['id'])) {
            $oldid = $_POST['id'];
            $sql = "update " . $tableConfig . " set code='" . $code . "',name='" . $name . "', parent='" . $parent . "',subject='" . $subject . "',detail_short='" . $detail_short . "',detail='" . $detail . "', sort='" . $sort . "', status='" . $status . "',last_modified=now(), lang='" . $lang . "' where id='" . $oldid . "'";
        } else {
            $sql = "insert into " . $tableConfig . " (code, name, parent, subject, detail_short, detail, sort, status,  date_added, last_modified, lang) values ('" . $code . "','" . $name . "','" . $parent . "','" . $subject . "','" . $detail_short . "','" . $detail . "','" . $sort . "','" . $status . "',now(),now(),'" . $lang . "')";
        }
        if (mysql_query($sql, $conn)) {
            if (empty($_POST['id'])) {
                $oldid = mysql_insert_id();
            }
            $r = getRecord($tableConfig, "id=" . $oldid);
            $sqlUpdateField = "";
            if ($_POST['chkClearImg'] == '') {
                $extsmall = getFileExtention($_FILES['txtImage']['name']);
开发者ID:ece4u,项目名称:ece4cWeb,代码行数:31,代码来源:content_advleft_bottom_m.php

示例6: file

		
		if(isset($_GET['action']) && $_GET['action'] == "upload")
		{	
			if(
				checkUpload("uploadedfile1") &&
				checkUpload("uploadedfile2") &&
				checkUpload("uploadedfile3") &&
				checkUpload("uploadedfile4") &&
				checkUpload("uploadedfile5") &&
				checkUpload("uploadedfile6") &&
				checkUpload("uploadedfile7") &&
				checkUpload("uploadedfile8") &&
				checkUpload("uploadedfile9") &&
				checkUpload("uploadedfile10") &&
				checkUpload("uploadedfile11") &&
				checkUpload("uploadedfile12")
			)
			{
				$text = "The file(s) has been upload succesfully";
				$target_dir = "/domains/stayinbuenosaires.com/public_html/pictures/apartments/".$_GET['apartmentid']."";
						
				if(!file_exists($target_dir)) 
				{	
					$conn_id = ftp_connect("62.212.87.110"); 
					$login_result = ftp_login($conn_id, "stayinbue", "E7dVRJdA"); 
					
					@ftp_mkdir($conn_id, $target_dir);
					
					ftp_chmod($conn_id, 0777, $target_dir);
					
					
开发者ID:64kbytes,项目名称:stayinba,代码行数:28,代码来源:addphotos.php

示例7: uploadFile

<?php

require_once 'session.php';
require_once 'pdo.php';
require_once 'functions.php';
if ($_FILES['userfile'] || $_POST['userfileurl']) {
    // if($_POST['userfileurl'] && urlExists($_POST['userfileurl'])) {
    //     $fileName = end(explode('/', $_POST['userfileurl']));
    //     $source = $_POST['userfileurl'];
    //     file_put_contents($uploadsDir . $fileName, file_get_contents($source));
    //     setProfilePicture($fileName);
    // };
    $fileName = $_FILES['userfile']['name'];
    $fileTmpName = $_FILES['userfile']['tmp_name'];
    $uploadsDir = 'uploads/';
    if (checkUpload($fileName, $fileTmpName)) {
        $uplodaded = uploadFile($fileName, $fileTmpName);
        if ($uplodaded != null) {
            updateUserImage($_SESSION["id"], $uplodaded['filename'], $uploadsDir, $uplodaded['extension']);
        }
    }
}
开发者ID:Rouksana,项目名称:ecvd-php,代码行数:22,代码来源:upload.php

示例8: isset

if (isset($_POST['btnSave'])) {
    $code = isset($_POST['txtCode']) ? trim($_POST['txtCode']) : '';
    $name = isset($_POST['txtName']) ? trim($_POST['txtName']) : '';
    $parent = $_POST['ddCat'];
    $subject = isset($_POST['txtSubject']) ? trim($_POST['txtSubject']) : '';
    $detail_short = isset($_POST['txtDetailShort']) ? trim($_POST['txtDetailShort']) : '';
    $detail = isset($_POST['txtDetail']) ? trim($_POST['txtDetail']) : '';
    $sort = isset($_POST['txtSort']) ? trim($_POST['txtSort']) : 0;
    $status = $_POST['chkStatus'] != '' ? 1 : 0;
    $catInfo = getRecord($tableCategoryConfig, 'id=' . $parent);
    $lang = $catInfo['lang'];
    if ($name == "") {
        $errMsg .= "Hãy nhập tên danh mục !<br>";
    }
    $errMsg .= checkUpload($_FILES["txtImage"], ".jpg;.gif;.bmp;.png", 2048 * 2048, 0);
    $errMsg .= checkUpload($_FILES["txtImageLarge"], ".jpg;.gif;.bmp;.png", 2048 * 2048, 0);
    if ($errMsg == '') {
        if (!empty($_POST['id'])) {
            $oldid = $_POST['id'];
            $sql = "update " . $tableConfig . " set code='" . $code . "',name='" . $name . "', parent='" . $parent . "',subject='" . $subject . "',detail_short='" . $detail_short . "',detail='" . $detail . "', sort='" . $sort . "', status='" . $status . "',last_modified=now(), lang='" . $lang . "' where id='" . $oldid . "'";
        } else {
            $sql = "insert into " . $tableConfig . " (code, name, parent, subject, detail_short, detail, sort, status,  date_added, last_modified, lang) values ('" . $code . "','" . $name . "','" . $parent . "','" . $subject . "','" . $detail_short . "','" . $detail . "','" . $sort . "','" . $status . "',now(),now(),'" . $lang . "')";
        }
        if (mysql_query($sql, $conn)) {
            if (empty($_POST['id'])) {
                $oldid = mysql_insert_id();
            }
            $r = getRecord($tableConfig, "id=" . $oldid);
            $sqlUpdateField = "";
            if ($_POST['chkClearImg'] == '') {
                $extsmall = getFileExtention($_FILES['txtImage']['name']);
开发者ID:ece4u,项目名称:ece4cWeb,代码行数:31,代码来源:news_m.php

示例9: foreach

     foreach ($error as $v) {
         echo '<span style="color:#FF0000">' . $v . "</span><br/>\n";
     }
 } else {
     $myPIC = $_FILES['pic'];
     $birth = strtotime($_POST['birth']);
     if ($_POST['select'] == "uplpro") {
         $ordner = dirmanager(0, $_POST['proname']);
     } elseif ($_POST['pro'] != 0) {
         $ordner = dirmanager($birth, $_POST['pro']);
     } else {
         $ordner = dirmanager($birth, 0);
     }
     $errors = array();
     if ($_POST['select'] == "uplsin") {
         $errors = checkUpload($myPIC, $file_extensions, $mime_types, $maxsize, $ordner);
     }
     if (count($errors)) {
         echo "<p>Die Datei konnte nicht gespeichert werden.<br/><br/>\n";
         foreach ($errors as $error) {
             echo $error . "<br/>\n";
         }
     } else {
         if ($_POST['select'] == "uplsin" && move_uploaded_file($myPIC['tmp_name'], $ordner . $myPIC['name'])) {
             if (!thumbmaker($myPIC['name'], $ordner, 500, 300, "thumblarge_")) {
                 echo "<p>Thumbnail konnte nicht erzeugt werden.</p><br/>\n";
             }
             if (!thumbmaker($myPIC['name'], $ordner, 70, 70, "thumbsmall_")) {
                 echo "<p>Thumbnail konnte nicht erzeugt werden.</p><br/>\n";
             }
             mysql_query("INSERT INTO grafikdb (timestamp, dir, file, title, birth, descr, type, projekt) VALUES ('{$timestamp}', '{$ordner}', '{$myPIC['name']}', '{$_POST['title']}', '{$birth}', '{$_POST['descr']}', '{$_POST['type']}', '{$_POST['pro']}')");
开发者ID:Therealleft,项目名称:CMS-Project-2011,代码行数:31,代码来源:upload.php

示例10: returnData

$key = 'icon_image';
if (isset($_REQUEST['key']) && $_REQUEST['key']) {
    $key = $_REQUEST['key'];
}
$_key = $key;
if (preg_match('/([a-zA-Z_]+)[0-9]*$/', $key, $matches)) {
    $_key = $matches[1];
}
if (!isset(BigAppConf::$imgRequire[$_key])) {
    returnData(1, 'invalid_param', $_key . "###" . $key);
}
$size = BigAppConf::$imgRequire[$_key];
if (isset($_REQUEST['key']) && $_REQUEST['key']) {
    $key = $_REQUEST['key'];
}
checkUpload($key, $size);
$url = uploadFile($_FILES[$key]);
if (!isset($size['need_compress']) || 1 == $size['need_compress']) {
    $realUrl = Utils::addUrlQueryString($_G['siteurl'] . 'plugin.php', array('size' => $size['width'] . '_' . $size['height'], 'url' => $url, 'id' => 'bigapp:optpic'));
} else {
    $realUrl = $url;
}
runlog('bigapp', 'end to upload a picture, return url: ' . $realUrl);
returnData(0, 'SUCC', array('imgurl' => $realUrl));
function uploadFile($file)
{
    global $_G;
    $upload = new discuz_upload();
    if (!$upload->init($file, 'common', rand(0, 100000), 'bigapp_' . md5_file($file['tmp_name']))) {
        returnData(7, 'init discuz init failed');
    }
开发者ID:Mushan3420,项目名称:BigApp-PHP7,代码行数:31,代码来源:uploadpic.inc.php


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