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


PHP SendResults函数代码示例

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


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

示例1: SendResults

// Check if it is an allowed extension.
if (count($arAllowed) > 0 && !in_array($sExtension, $arAllowed) || count($arDenied) > 0 && in_array($sExtension, $arDenied)) {
    SendResults('202');
}
$sErrorNumber = '0';
$sFileUrl = '';
// Initializes the counter used to rename the file, if another one with the same name already exists.
$iCounter = 0;
// The the target directory.
$sServerDir = GetRootPath() . $Config["UserFilesPath"];
while (true) {
    // Compose the file path.
    $sFilePath = $sServerDir . $sFileName;
    // If a file with that name already exists.
    if (is_file($sFilePath)) {
        $iCounter++;
        $sFileName = RemoveExtension($sOriginalFileName) . '(' . $iCounter . ').' . $sExtension;
        $sErrorNumber = '201';
    } else {
        move_uploaded_file($oFile['tmp_name'], $sFilePath);
        if (is_file($sFilePath)) {
            $oldumask = umask(0);
            chmod($sFilePath, 0777);
            umask($oldumask);
        }
        $sFileUrl = $Config["UserFilesPath"] . $sFileName;
        break;
    }
}
SendResults($sErrorNumber, $sFileUrl, $sFileName);
开发者ID:BackupTheBerlios,项目名称:livealphaprint,代码行数:30,代码来源:upload.php

示例2: str_replace

// link or alias. Examples: 'C:\\MySite\\userfiles\\' or '/root/mysite/userfiles/'.
// Attention: The above 'UserFilesPath' must point to the same directory.
$Config['UserFilesAbsolutePath'] = '';
/**#@+
 * Custom configs for XOOPS
 *
 **/
$current_path = str_replace(DIRECTORY_SEPARATOR, "/", dirname(__FILE__));
$fckeditor_root_path = substr($current_path, 0, stripos($current_path, "/fckeditor/fckeditor/editor/"));
$file = $fckeditor_root_path . "/xoopseditor.inc.php";
if (!@(include $file)) {
    SendResults(1, '', '', "Editor init file is not found: xoopseditor.inc.php");
    exit;
}
if (!defined("XOOPS_UPLOAD_PATH")) {
    SendResults(1, '', '', "XOOPS_UPLOAD_PATH is not defined!");
    exit;
}
$uploadPath = defined("XOOPS_FCK_FOLDER") ? preg_replace("/[^a-z0-9_\\-]/i", "", XOOPS_FCK_FOLDER) : "fckeditor";
// SECURITY: You must explicitly enable this "connector". (Set it to "true").
// WARNING: don't just set "$Config['Enabled'] = true ;", you must be sure that only
//		authenticated users can access this file or use some kind of session checking.
$Config['Enabled'] = true;
// Path to uploaded files relative to the document root.
$Config['UserFilesPath'] = XOOPS_UPLOAD_URL . "/" . $uploadPath . "/";
// Fill the following value it you prefer to specify the absolute path for the
// user files directory. Usefull if you are using a virtual directory, symbolic
// link or alias. Examples: 'C:\\MySite\\userfiles\\' or '/root/mysite/userfiles/'.
// Attention: The above 'UserFilesPath' must point to the same directory.
$Config['UserFilesAbsolutePath'] = XOOPS_UPLOAD_PATH . "/" . $uploadPath . "/";
/**#@-*/
开发者ID:yunsite,项目名称:xoopsdc,代码行数:31,代码来源:config.php

示例3: SendAlert

        if (!empty($s_invalid)) {
            $s_error .= "recipients: {$s_invalid}\r\n";
        }
        if (!empty($s_invalid_cc)) {
            $s_error .= "cc: {$s_invalid_cc}\r\n";
        }
        if (!empty($s_invalid_bcc)) {
            $s_error .= "bcc: {$s_invalid_bcc}\r\n";
        }
        if (!empty($s_error)) {
            SendAlert(GetMessage(MSG_INV_EMAIL, array("ERRORS" => $s_error)));
        }
        //
        // send the actual results
        //
        if (!SendResults($aFieldOrder, $aCleanedValues, $s_valid_recipients, $s_valid_cc, $s_valid_bcc, $aRawDataValues)) {
            Error("mail_failed", GetMessage(MSG_FAILED_SEND));
        }
        //
        // Hook system: after sending emails
        //
        if ($HOOK_DIR !== "") {
            if (!@(include "{$HOOK_DIR}/fmhookpostemail.inc.php")) {
                @(include "{$HOOK_DIR}/fmhookpostemail.inc");
            }
        }
    }
}
//
// Process autoresponse
//
开发者ID:chrismathers,项目名称:premierplacement,代码行数:31,代码来源:resumemailer_061612.php

示例4: dirname

<?php

@set_time_limit(0);
include_once dirname(__FILE__) . "./../general.inc.php";
include_once M_ROOT . "./include/upload.cls.php";
$c_upload = new cls_upload();
$uploadfile = $c_upload->local_upload('Newfile', $_GET['type']);
unset($c_upload);
if ($uploadfile['error']) {
    SendResults('202');
} else {
    $sErrorNumber = '0';
    SendResults('0', tag2atm($uploadfile['remote']));
}
function SendResults($errorNumber, $fileUrl = '', $fileName = '', $customMsg = '')
{
    echo '<script type="text/javascript">';
    echo 'window.parent.OnUploadCompleted(' . $errorNumber . ',"' . str_replace('"', '\\"', $fileUrl) . '","' . str_replace('"', '\\"', $fileName) . '","' . str_replace('"', '\\"', $customMsg) . '");';
    echo '</script>';
    mexit();
}
开发者ID:polarlight1989,项目名称:08cms,代码行数:21,代码来源:upload.php


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