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


PHP cfip函数代码示例

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


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

示例1: header

<?php

!cfip() ? header('HTTP/1.1 401 Unauthorized') : 0;
class Mail extends Base
{
    /**
     * Mail form contact site admin
     * @param senderName string senderName
     * @param senderEmail string senderEmail
     * @param senderSubject string senderSubject
     * @param senderMessage string senderMessage
     * @param email string config Email address
     * @param subject string header subject
     * @return bool
     **/
    public function contactform($senderName, $senderEmail, $senderSubject, $senderMessage)
    {
        $this->debug->append("STA " . __METHOD__, 4);
        if (preg_match('/[^a-z_\\.\\!\\?\\-0-9\\s ]/i', $senderName)) {
            $this->setErrorMessage($this->getErrorMsg('E0024'));
            return false;
        }
        if (empty($senderEmail) || !filter_var($senderEmail, FILTER_VALIDATE_EMAIL)) {
            $this->setErrorMessage($this->getErrorMsg('E0023'));
            return false;
        }
        if (preg_match('/[^a-z_\\.\\!\\?\\-0-9\\s ]/i', $senderSubject)) {
            $this->setErrorMessage($this->getErrorMsg('E0034'));
            return false;
        }
        if (strlen(strip_tags($senderMessage)) < strlen($senderMessage)) {
开发者ID:noncepool,项目名称:php-mpos,代码行数:31,代码来源:mail.class.php

示例2: exit

<?php

$defflip = !cfip() ? exit(header('HTTP/1.1 401 Unauthorized')) : 1;
// Check user to ensure they are admin
if (!$user->isAuthenticated() || !$user->isAdmin($_SESSION['USERDATA']['id'])) {
    header("HTTP/1.1 404 Page not found");
    die("404 Page not found");
}
// Include markdown library
use Michelf\Markdown;
if ($setting->getValue('notifications_disable_pool_newsletter', 0) == 1) {
    $_SESSION['POPUP'][] = array('CONTENT' => 'Pool newsletters are disabled.', 'TYPE' => 'alert alert-info');
    $smarty->assign("CONTENT", "");
} else {
    if (@$_REQUEST['do'] == 'send') {
        if (!$config['csrf']['enabled'] || $config['csrf']['enabled'] && $csrftoken->valid) {
            $iFailed = 0;
            $iSuccess = 0;
            foreach ($user->getAllAssoc() as $aData) {
                $aUserNotificationSettings = $notification->getNotificationSettings($aData['id']);
                if ($aData['is_locked'] != 0 || $aUserNotificationSettings['newsletter'] != 1 || empty($aData['email'])) {
                    continue;
                }
                $aData['subject'] = $_REQUEST['data']['subject'];
                $aData['CONTENT'] = $_REQUEST['data']['content'];
                if (!$mail->sendMail('newsletter/body', $aData, true)) {
                    $iFailed++;
                } else {
                    $iSuccess++;
                }
            }
开发者ID:ed-ro0t,项目名称:php-mpos,代码行数:31,代码来源:newsletter.inc.php


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