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


PHP project::addfile方法代碼示例

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


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

示例1: user

<?php

session_start();
require_once $_SERVER['DOCUMENT_ROOT'] . "/common/class/common.class.php";
require_once $_SERVER['DOCUMENT_ROOT'] . "/common/class/project.class.php";
require_once $_SERVER['DOCUMENT_ROOT'] . "/common/class/user.class.php";
require_once $_SERVER['DOCUMENT_ROOT'] . "/common/class/config.class.php";
$objuser = new user();
$objuser->checkLoginAjax();
if (is_array($_POST)) {
    $objproject = new project();
    $objproject->update($_POST);
    if (isset($_SESSION['tempfilename'])) {
        $fp = fopen($_SESSION['tempfilename'], 'r');
        $content = fread($fp, $_SESSION['filesize']);
        fclose($fp);
        $objproject->addfile($_SESSION['filename'], $_SESSION['filetype'], $_SESSION['filesize'], $content, $_POST['projectid']);
    }
    echo "script: messageBox('Project Updated',function() { window.location='account.php'; });";
}
開發者ID:sknlim,項目名稱:classified-2,代碼行數:20,代碼來源:editpostproject1.php

示例2: user

session_start();
require_once $_SERVER['DOCUMENT_ROOT'] . "/common/class/common.class.php";
require_once $_SERVER['DOCUMENT_ROOT'] . "/common/class/project.class.php";
require_once $_SERVER['DOCUMENT_ROOT'] . "/common/class/user.class.php";
require_once $_SERVER['DOCUMENT_ROOT'] . "/common/class/config.class.php";
$objuser = new user();
$objuser->checkLoginAjax();
if (strtoupper($_SESSION['foongigs_usertype']) == "PROVIDER") {
    echo "script: messageBox('Sorry!, Only SEEKER can post a project');";
    exit;
}
/* if(isset($_SESSION['counter']))
	$_SESSION['counter']++;
else
	$_SESSION['counter']=1;
echo $_SESSION['counter'];
print_r($_POST);
exit();
*/
if (is_array($_POST)) {
    $objproject = new project();
    $projectid = $objproject->add($_POST);
    if (isset($_SESSION['tempfilename'])) {
        $fp = fopen($_SESSION['tempfilename'], 'r');
        $content = fread($fp, $_SESSION['filesize']);
        fclose($fp);
        $objproject->addfile($_SESSION['filename'], $_SESSION['filetype'], $_SESSION['filesize'], $content, $projectid);
    }
    echo "script: messageBox('Project Posted',function() { window.location='account.php'; });";
}
開發者ID:sknlim,項目名稱:classified-2,代碼行數:30,代碼來源:postproject1.php


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