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


PHP send_request函數代碼示例

本文整理匯總了PHP中send_request函數的典型用法代碼示例。如果您正苦於以下問題:PHP send_request函數的具體用法?PHP send_request怎麽用?PHP send_request使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


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

示例1: client_updateAutoresponder

/**
 * Update autoresponder of the given mail account
 *
 * @param int $mailAccountId Mail account id
 * @param string $autoresponderMessage Auto-responder message
 * @return void
 */
function client_updateAutoresponder($mailAccountId, $autoresponderMessage)
{
    $autoresponderMessage = clean_input($autoresponderMessage);
    if ($autoresponderMessage == '') {
        set_page_message(tr('Auto-responder message cannot be empty.'), 'error');
        redirectTo("mail_autoresponder_enable.php?mail_account_id={$mailAccountId}");
    } else {
        $db = iMSCP_Database::getInstance();
        try {
            $db->beginTransaction();
            $query = "SELECT `mail_addr` FROM `mail_users` WHERE `mail_id` = ?";
            $stmt = exec_query($query, $mailAccountId);
            $query = "UPDATE `mail_users` SET `status` = ?, `mail_auto_respond_text` = ? WHERE `mail_id` = ?";
            exec_query($query, array('tochange', $autoresponderMessage, $mailAccountId));
            // Purge autoreplies log entries
            delete_autoreplies_log_entries();
            $db->commit();
            // Ask iMSCP daemon to trigger engine dispatcher
            send_request();
            write_log(sprintf("%s: Updated auto-responder for the '%s' mail account", $_SESSION['user_logged'], $stmt->fields['mail_addr']), E_USER_NOTICE);
            set_page_message(tr('Auto-responder successfully scheduled for update.'), 'success');
        } catch (iMSCP_Exception_Database $e) {
            $db->rollBack();
            throw $e;
        }
    }
}
開發者ID:svenjantzen,項目名稱:imscp,代碼行數:34,代碼來源:mail_autoresponder_edit.php

示例2: client_updateHtaccessUser

/**
 * Updates htaccess user.
 *
 * @param int $dmn_id Domain unique identifier
 * @param int $uuser_id Htaccess user unique identifier
 * @return
 */
function client_updateHtaccessUser(&$dmn_id, &$uuser_id)
{
    if (isset($_POST['uaction']) && $_POST['uaction'] == 'modify_user') {
        // we have to add the user
        if (isset($_POST['pass']) && isset($_POST['pass_rep'])) {
            if (!checkPasswordSyntax($_POST['pass'])) {
                return;
            }
            if ($_POST['pass'] !== $_POST['pass_rep']) {
                set_page_message(tr("Passwords do not match."), 'error');
                return;
            }
            $nadmin_password = cryptPasswordWithSalt($_POST['pass'], generateRandomSalt(true));
            $change_status = 'tochange';
            $query = "\n\t\t\t\tUPDATE\n\t\t\t\t\t`htaccess_users`\n\t\t\t\tSET\n\t\t\t\t\t`upass` = ?, `status` = ?\n\t\t\t\tWHERE\n\t\t\t\t\t`dmn_id` = ?\n\t\t\t\tAND\n\t\t\t\t\t`id` = ?\n\t\t\t";
            exec_query($query, array($nadmin_password, $change_status, $dmn_id, $uuser_id));
            send_request();
            $query = "\n\t\t\t\tSELECT\n\t\t\t\t\t`uname`\n\t\t\t\tFROM\n\t\t\t\t\t`htaccess_users`\n\t\t\t\tWHERE\n\t\t\t\t\t`dmn_id` = ?\n\t\t\t\tAND\n\t\t\t\t\t`id` = ?\n\t\t\t";
            $rs = exec_query($query, array($dmn_id, $uuser_id));
            $uname = $rs->fields['uname'];
            $admin_login = $_SESSION['user_logged'];
            write_log("{$admin_login}: updated htaccess user ID: {$uname}", E_USER_NOTICE);
            redirectTo('protected_user_manage.php');
        }
    } else {
        return;
    }
}
開發者ID:svenjantzen,項目名稱:imscp,代碼行數:35,代碼來源:protected_user_edit.php

示例3: gen_page_dynamic_data

function gen_page_dynamic_data(&$tpl, &$sql, $mail_id)
{
    global $cfg;
    if (isset($_POST['uaction']) && $_POST['uaction'] === 'enable_arsp') {
        if ($_POST['arsp_message'] === '') {
            $tpl->assign('ARSP_MESSAGE', '');
            set_page_message(tr('Please type your mail autorespond message!'));
            return;
        }
        $arsp_message = $_POST['arsp_message'];
        $item_change_status = $cfg['ITEM_CHANGE_STATUS'];
        check_for_lock_file();
        $query = <<<SQL_QUERY
            update
                mail_users
            set
                status = ?,
                mail_auto_respond = ?
            where
                mail_id = ?
SQL_QUERY;
        $rs = exec_query($sql, $query, array($item_change_status, $arsp_message, $mail_id));
        send_request();
        write_log($_SESSION['user_logged'] . " : add mail autorsponder");
        set_page_message(tr('Mail account scheduler for modification!'));
        header("Location: email_accounts.php");
        exit(0);
    } else {
        $tpl->assign('ARSP_MESSAGE', '');
    }
}
開發者ID:BackupTheBerlios,項目名稱:vhcs-svn,代碼行數:31,代碼來源:enable_mail_arsp.php

示例4: scheduleBackupRestoration

/**
 * Schedule backup restoration.
 *
 * @param int $userId Customer unique identifier
 * @return void
 */
function scheduleBackupRestoration($userId)
{
    exec_query("UPDATE `domain` SET `domain_status` = ? WHERE `domain_admin_id` = ?", array('torestore', $userId));
    send_request();
    write_log($_SESSION['user_logged'] . ": scheduled backup restoration.", E_USER_NOTICE);
    set_page_message(tr('Backup has been successfully scheduled for restoration.'), 'success');
}
開發者ID:svenjantzen,項目名稱:imscp,代碼行數:13,代碼來源:backup.php

示例5: padd_group

function padd_group($tpl, $sql, $dmn_id)
{
    $cfg = EasySCP_Registry::get('Config');
    if (isset($_POST['uaction']) && $_POST['uaction'] == 'add_group') {
        // we have to add the group
        if (isset($_POST['groupname'])) {
            if (!validates_username($_POST['groupname'])) {
                set_page_message(tr('Invalid group name!'), 'warning');
                return;
            }
            $groupname = $_POST['groupname'];
            $query = "\n\t\t\t\tSELECT\n\t\t\t\t\t`id`\n\t\t\t\tFROM\n\t\t\t\t\t`htaccess_groups`\n\t\t\t\tWHERE\n\t\t\t\t\t`ugroup` = ?\n\t\t\t\tAND\n\t\t\t\t\t`dmn_id` = ?\n\t\t\t";
            $rs = exec_query($sql, $query, array($groupname, $dmn_id));
            if ($rs->recordCount() == 0) {
                $change_status = $cfg->ITEM_ADD_STATUS;
                $query = "\n\t\t\t\t\tINSERT INTO `htaccess_groups`\n\t\t\t\t\t\t(`dmn_id`, `ugroup`, `status`)\n\t\t\t\t\tVALUES\n\t\t\t\t\t\t(?, ?, ?)\n\t\t\t\t";
                exec_query($sql, $query, array($dmn_id, $groupname, $change_status));
                send_request();
                $admin_login = $_SESSION['user_logged'];
                write_log("{$admin_login}: add group (protected areas): {$groupname}");
                user_goto('protected_user_manage.php');
            } else {
                set_page_message(tr('Group already exists!'), 'error');
                return;
            }
        } else {
            set_page_message(tr('Invalid group name!'), 'error');
            return;
        }
    } else {
        return;
    }
}
開發者ID:gOOvER,項目名稱:EasySCP,代碼行數:33,代碼來源:protected_group_add.php

示例6: client_addHtaccessGroup

/**
 * Adds Htaccess group.
 *
 * @param int $domainId Domain unique identifier
 * @return
 */
function client_addHtaccessGroup($domainId)
{
    if (isset($_POST['uaction']) && $_POST['uaction'] == 'add_group') {
        // we have to add the group
        if (isset($_POST['groupname'])) {
            if (!validates_username($_POST['groupname'])) {
                set_page_message(tr('Invalid group name!'), 'error');
                return;
            }
            $groupname = $_POST['groupname'];
            $query = "\n\t\t\t\tSELECT\n\t\t\t\t\t`id`\n\t\t\t\tFROM\n\t\t\t\t\t`htaccess_groups`\n\t\t\t\tWHERE\n\t\t\t\t\t`ugroup` = ?\n\t\t\t\tAND\n\t\t\t\t\t`dmn_id` = ?\n\t\t\t";
            $rs = exec_query($query, array($groupname, $domainId));
            if ($rs->rowCount() == 0) {
                $change_status = 'toadd';
                $query = "\n\t\t\t\t\tINSERT INTO `htaccess_groups` (\n\t\t\t\t\t    `dmn_id`, `ugroup`, `status`\n\t\t\t\t\t) VALUES (\n\t\t\t\t\t    ?, ?, ?\n\t\t\t\t\t)\n\t\t\t\t";
                exec_query($query, array($domainId, $groupname, $change_status));
                send_request();
                set_page_message(tr('Htaccess group successfully scheduled for addition.'), 'success');
                $admin_login = $_SESSION['user_logged'];
                write_log("{$admin_login}: added htaccess group: {$groupname}", E_USER_NOTICE);
                redirectTo('protected_user_manage.php');
            } else {
                set_page_message(tr('This htaccess group already exists.'), 'error');
                return;
            }
        } else {
            set_page_message(tr('Invalid htaccess group name.'), 'error');
            return;
        }
    } else {
        return;
    }
}
開發者ID:svenjantzen,項目名稱:imscp,代碼行數:39,代碼來源:protected_group_add.php

示例7: get_uptime

function get_uptime()
{
    global $passwords, $uptime, $cache_file;
    $all_time = send_request("summary.average/" . $passwords->pingdom->checkid . "?includeuptime=true");
    $last_month = send_request("summary.average/" . $passwords->pingdom->checkid . "?includeuptime=true&from=" . (time() - 2592000));
    $uptime = array("all_time" => $all_time->summary->status->totalup / ($all_time->summary->status->totalup + $all_time->summary->status->totaldown), "last_month" => $last_month->summary->status->totalup / ($last_month->summary->status->totalup + $last_month->summary->status->totaldown));
    file_put_contents($cache_file, "<?php\n  \$last_check = " . var_export(time(), true) . ";\n\n  \$uptime = " . var_export($uptime, true) . ";\n?" . ">");
}
開發者ID:mcenderdragon,項目名稱:Icon-Craft,代碼行數:8,代碼來源:uptime.php

示例8: died

 function died($error)
 {
     $data = "We are very sorry, but there were error(s) found with the form you submitted. ";
     $data .= "These errors appear below.<br />";
     $data .= $error;
     $data .= "Please go back and fix these errors.<br />";
     send_request($data, true);
 }
開發者ID:kgrant360,項目名稱:geekchicprogramming.com,代碼行數:8,代碼來源:send-form-email.php

示例9: make_request

function make_request()
{
    $user = $_GET['login'];
    $password = md5($_GET['password']);
    $packet_id = wddx_packet_start("Authentication Request");
    wddx_add_vars($packet_id, 'user', 'password');
    $packet = wddx_packet_end($packet_id);
    // make a custom POST request to the server with the wddx packet
    return send_request($packet);
}
開發者ID:SandyS1,項目名稱:presentations,代碼行數:10,代碼來源:client.inc.php

示例10: get_api_data

function get_api_data($url, $param = array())
{
    $url = API_URL . $url;
    $sign = encrypt($param);
    $param['sign'] = $sign;
    $api_str = send_request($url, $param);
    if (is_json($api_str)) {
        return json_decode($api_str, TRUE);
    } else {
        return return_format(array($api_str), "json_str 解析錯誤,這是api內部報錯!請聯係1162097842@qq.com", API_NORMAL_ERR);
    }
}
開發者ID:codekissyoung,項目名稱:filmfest,代碼行數:12,代碼來源:functions.php

示例11: opendkim_deactivate

/**
 * Deactivate OpenDKIM for the given customer
 *
 * @param int $customerId Customer unique identifier
 * @return void
 */
function opendkim_deactivate($customerId)
{
    $stmt = exec_query('SELECT COUNT(admin_id) AS cnt FROM admin WHERE admin_id = ? AND created_by = ? AND admin_status = ?', array($customerId, $_SESSION['user_id'], 'ok'));
    $row = $stmt->fetchRow(PDO::FETCH_ASSOC);
    if ($row['cnt']) {
        exec_query('UPDATE opendkim SET opendkim_status = ? WHERE admin_id = ?', array('todelete', $customerId));
        send_request();
        set_page_message(tr('OpenDKIM support scheduled for deactivation. This can take few seconds.'), 'success');
    } else {
        showBadRequestErrorPage();
    }
}
開發者ID:reneschuster,項目名稱:plugins,代碼行數:18,代碼來源:opendkim.php

示例12: submit

 public function submit()
 {
     //先接受get數組,然後再填充到conf裏麵
     $conf = ['rzm' => 2013214368, 'xm' => 'ling', 'ip' => '202.202.41.125', 'bt' => '這是測試數據,請穆老師處理', 'fwxmh' => 01, 'bxdh' => 18580024667, 'fwquy' => '', 'wxdd' => '27棟', 'bxnr' => '這是測試數據,請穆老師處理', 'wxdjh' => 'a66222d0-f5ba-4fe5-86d4-a3cd01815db4', 'hfmyd' => '滿意', 'hfjy' => '這是測試數據,請穆老師處理'];
     $wxdh = send_request('RepairApp', $conf);
     //提交
     if ($wxdh) {
         $this->ajaxReturn(true);
     } else {
         $this->ajaxReturn(false);
     }
 }
開發者ID:RedrockTeam,項目名稱:report,代碼行數:12,代碼來源:SubmitController.class.php

示例13: performTest

 public function performTest($testName)
 {
     $testUri = testCase::BASE_SERVICE . $testName . '.' . testCase::RESPONSE_FORMAT;
     echo_line('<pre>');
     echo_line("Request:");
     echo_line("\t" . $testUri);
     echo_line("\nResponse:\n");
     $response = send_request($testUri, 'GET');
     $coder = new CJSON();
     $object = $coder->decode($response);
     print_as_json('', $object);
     echo_line('</pre>');
 }
開發者ID:rosko,項目名稱:AlmazService,代碼行數:13,代碼來源:testClassSheme.php

示例14: returnVisit

 public function returnVisit()
 {
     if (session('stuId') && session('wx_djh') && I('post.hfmyd') && I('post.hfjy')) {
         $conf = ['rzm' => session('stuId'), 'wxdjh' => session('get.wx_djh'), 'hfmyd' => I('post.hfmyd'), 'hfjy' => I('post.hfjy')];
         if (send_request('PayReturnVisit', $conf)) {
             $this->ajaxReturn(true);
         } else {
             $this->ajaxReturn(false);
         }
     } else {
         $this->error('數據填寫不完整');
     }
 }
開發者ID:RedrockTeam,項目名稱:report-repair-fe,代碼行數:13,代碼來源:DetailController.class.php

示例15: firstLoad

 public function firstLoad()
 {
     $conf = ['id' => session('stuId')];
     $res = send_request('InfoById', $conf);
     //獲取從接口拿到的保修單數據
     if ($res) {
         D('Globle')->cacheRefresh($res);
         //每次查詢的時候跟新本地緩存
         $this->LoadUnfinishedData();
     } else {
         //查看是否為接口問題
         $this->LoadUnfinishedData();
     }
 }
開發者ID:RedrockTeam,項目名稱:report-repair-fe,代碼行數:14,代碼來源:IndexController.class.php


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