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


PHP doPost函数代码示例

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


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

示例1: artistAdd

function artistAdd($num = 1)
{
    $request = "http://localhost/dev/yahoo_music/dev/artist.php";
    //	$request = "http://p1.osp.hki.yahoo.com/admin/artist.php";
    for ($index = 0; $index <= $num; $index++) {
        $artistcode = "artistcode" . mt_rand(99999, 10000000);
        $artistname = "artistname" . mt_rand(99999, 10000000);
        $artistname_eng = "artistname_eng" . mt_rand(99999, 10000000);
        $initial = chr(mt_rand(ord('a'), ord('z')));
        $postargs = "act=AddSubmit&artistcode={$artistcode}&artistname={$artistname}&artistname_eng={$artistname_eng}&initial={$initial}";
        doPost($request, $postargs);
    }
    echo "success submit {$num} request ";
}
开发者ID:BackupTheBerlios,项目名称:flushcms,代码行数:14,代码来源:auto.php

示例2: doSchedule

function doSchedule($deviceId, $sch)
{
    if (is_string($sch)) {
        $days = explode(":", $sch);
        foreach ($days as $day) {
            $result = doPost($deviceId, "receiveSch", $day);
            if ($result != "Success") {
                break;
            }
        }
        return $result;
    } else {
        return "Invalid schedule";
    }
}
开发者ID:roberttidey,项目名称:remoteRad,代码行数:15,代码来源:remote.php

示例3: google_auth

function google_auth($auth, $email, $pass)
{
    $gacookie = "gacookie";
    $url = $auth;
    $postdata = "Email=" . $email . "&Passwd=" . $pass . "&accountType=GOOGLE&service=apps";
    $referer = 'https://www.google.com/accounts/ClientLogin';
    $result = doPost(compact('gacookie', 'postdata', 'url', 'referer'));
    ereg('Auth=(.*)', $result, $googToken);
    $Token = $googToken[1];
    if ($Token) {
        return array(True, $Token);
    } else {
        return array(False);
    }
}
开发者ID:helenadeus,项目名称:s3db.map,代码行数:15,代码来源:authentication.php

示例4: hookAction

 /**
  * 触发关联动作
  *
  * @author young
  * @name 触发关联动作
  * @version 2014.02.12 young
  */
 public function hookAction()
 {
     $collection_id = isset($_REQUEST['__COLLECTION_ID__']) ? trim($_REQUEST['__COLLECTION_ID__']) : '';
     $collectionInfo = $this->_collection->findOne(array('_id' => myMongoId($collection_id), 'project_id' => $this->_project_id));
     if ($collectionInfo != null) {
         try {
             $postDatas = array('__PROJECT_ID__' => $this->_project_id, '__COLLECTION_ID__' => $collection_id);
             $url = $collectionInfo['hook'];
             $hookKey = $collectionInfo['hookKey'];
             $sign = dataSignAlgorithm($postDatas, $hookKey);
             $postDatas['__SIGN__'] = $sign;
             $response = doPost($url, $postDatas);
             if ($response === false) {
                 return $this->msg(false, '网络请求失败');
             }
             $this->_collection->update(array('_id' => myMongoId($collection_id)), array('$set' => array('hookLastResponseResult' => $response)));
             return $this->msg(true, '触发联动操作成功');
         } catch (\Exception $e) {
             return $this->msg(false, $e->getMessage());
         }
     } else {
         return $this->msg(false, '触发联动操作失败');
     }
 }
开发者ID:im286er,项目名称:ent,代码行数:31,代码来源:CollectionController.php

示例5: doPost

if (isset($mReturn->output[0]))
{
	echo '<h3>Checking if Friends with User #' . $mReturn->output[0]->user_id . ' [friend.isFriend]</h3>';
	$mReturn = doPost('friend.isFriend', array('friend_user_id' => $mReturn->output[0]->user_id));
 	echo '<pre>' . print_r($mReturn, true) . '</pre>';
}

echo '<h3>Updating Users Status [user.updateStatus]</h3>';
$mReturn = doPost('user.updateStatus', array('user_status' => 'This is a test status update from an application... [' . uniqid() . ']'));
echo '<pre>' . print_r($mReturn, true) . '</pre>';

echo '<h3>Getting Photos [photo.getPhotos]</h3>';
$mReturn = doPost('photo.getPhotos');
echo '<pre>' . print_r($mReturn, true) . '</pre>';

echo '<h3>Getting New Notifications Count [notification.getNewCount]</h3>';
$mReturn = doPost('notification.getNewCount');
echo '<pre>' . print_r($mReturn, true) . '</pre>';

echo '<h3>Getting Notifications [notification.get]</h3>';
$mReturn = doPost('notification.get');
echo '<pre>' . print_r($mReturn, true) . '</pre>';

echo '<h3>Getting New Mail Count [mail.getNewCount]</h3>';
$mReturn = doPost('mail.getNewCount');
echo '<pre>' . print_r($mReturn, true) . '</pre>';

?>
	</body>
</html>
开发者ID:hoanghd,项目名称:tools,代码行数:30,代码来源:index.php

示例6: addCase

function addCase($inbound)
{
    $case_post_link = '';
    // initialize ...
    //
    // STEP 1 - find (or create) Customer object
    //
    $customers = lookForCustomer($inbound['email']);
    $new_customer = false;
    if (count($customers) !== 0) {
        $case_post_link = $customers[0]->_links->cases->href;
    } else {
        // assemble address!
        $address = assembleAddress($inbound);
        $customer = array('first_name' => $inbound['first_name'], 'last_name' => $inbound['last_name'], 'emails' => array(array('type' => 'home', 'value' => $inbound['email'])), 'phone_numbers' => array(array('type' => 'home', 'value' => $inbound['phone'])), 'addresses' => array(array('type' => 'home', 'value' => $address)));
        if (isset($inbound['community'])) {
            if (!isset($customer['custom_fields'])) {
                $customer['custom_fields'] = array();
            }
            $customer['custom_fields']['community'] = $inbound['community'];
        }
        $response = doPost('/api/v2/customers', json_encode($customer));
        $case_post_link = $response->_links->cases->href;
        $new_customer = true;
    }
    //
    // STEP 2 - build message
    //
    $message = '';
    $message .= 'How long have you been attending?';
    $message .= "\n- " . ($inbound['howlongattending'] ? $inbound['howlongattending'] : '(empty)');
    if ($inbound['howlongattending'] == 'Other') {
        $message .= ': ' . ($inbound['howlongattending-other'] ? $inbound['howlongattending-other'] : '(empty)');
    }
    $message .= "\n\n";
    $message .= 'How can we help?';
    if (isset($inbound['help']) && is_array($inbound['help']) && count($inbound['help'])) {
        foreach ($inbound['help'] as $item) {
            $message .= "\n- {$item}";
            if (preg_match('/\\bmeet\\b.+\\bleader\\b/', $item)) {
                $message .= "\n- -   " . ($inbound['meet-leader'] ? $inbound['meet-leader'] : '(empty)');
            } elseif (preg_match('/\\blike\\b.+\\bprayer\\b/', $item)) {
                $message .= "\n- -   " . ($inbound['prayer-request'] ? $inbound['prayer-request'] : '(empty)');
            }
        }
    } else {
        $message .= "\n- (none selected)";
    }
    $message .= "\n\n";
    $message .= 'Serving ministries...';
    if (isset($inbound['ministry']) && is_array($inbound['ministry']) && count($inbound['ministry'])) {
        foreach ($inbound['ministry'] as $item) {
            $message .= "\n- {$item}";
        }
    } else {
        $message .= "\n- (none selected)";
    }
    $message .= "\n\n";
    $message .= 'Which Community do you live in or are you interested in checking out?';
    $message .= "\n- " . ($inbound['community'] ? $inbound['community'] : '(empty)');
    if (!$new_customer) {
        $message .= "\n";
        $message .= "\n-------------";
        $message .= "Warning: customer already existed!  No customer information was updated!";
        $message .= "\n-------------";
    }
    $message .= "\n\n";
    $message .= "\n-------------";
    /*
       $message .= "All inbound information: ";
       $message .= "\n";
       $message .= print_r($inbound, true);
    */
    //
    // STEP 3 - create Case
    //
    $subject = $inbound['first_name'];
    if ($inbound['first_name'] && $inbound['last_name']) {
        $subject .= ' ';
    }
    $subject .= ' - wants to connect!';
    // WITH MIKE 20150702
    // TODO - extra credit - use whatever they use for desire...
    $subject = 'Connecting with Downtown Cornerstone Church';
    if (isset($inbound['help']) && is_array($inbound['help']) && count($inbound['help']) === 1) {
        $subject = 'DCC - ' . $inbound['help'][0];
    }
    $case = array('type' => 'email', 'subject' => $subject, 'priority' => 4, 'status' => 'open', 'message' => array('direction' => 'in', 'subject' => $subject, 'body' => $message, 'to' => 'natephptestdcc@natemassey.com', 'from' => $inbound['email']));
    return doPost($case_post_link, json_encode($case));
}
开发者ID:jimmynono,项目名称:DCC-Form,代码行数:90,代码来源:postit.php

示例7: file_get_contents

        $resultfilename = "result_" . $crashid . ".crash";
        echo "Processing crash id " . $crashid . " ...\n";
        echo "  Downloading crash data ...\n";
        $log = file_get_contents($getcrashdataurl . $crashid);
        if ($log !== false && strlen($log) > 0) {
            echo "  Writing log data into temporary file ...\n";
            $output = fopen($filename, 'w+');
            fwrite($output, $log);
            fclose($output);
            echo "  Symbolicating ...\n";
            exec('./symbolicatecrash -o ' . $resultfilename . ' ' . $filename);
            unlink($filename);
            if (file_exists($resultfilename) && filesize($resultfilename) > 0) {
                echo "  Sending symbolicated data back to the server ...\n";
                $resultcontent = file_get_contents($resultfilename);
                $post_results = doPost('id=' . $crashid . '&log=' . urlencode($resultcontent));
                if (is_string($post_results)) {
                    if ($post_results == 'success') {
                        echo '  SUCCESS!';
                    }
                }
            }
            echo "  Deleting temporary files ...\n";
            unlink($resultfilename);
        }
    }
    echo "\nDone\n\n";
} else {
    if ($content !== false) {
        echo "Nothing to do.\n\n";
    }
开发者ID:nikunjagr,项目名称:QuincyKit,代码行数:31,代码来源:symbolicate.php

示例8: initRackTablesItem

function initRackTablesItem($objectDatas)
{
    // zabbix item data
    $params = array('output' => 'extend');
    $result = doPost('item.get', $params);
    $items = isset($result['result']) ? $result['result'] : array();
    foreach ($items as $item) {
        usePreparedInsertBlade('item_information', array('itemid' => $item['itemid'], 'objectid' => $objectDatas[$item['hostid']], 'hostid' => $item['hostid'], 'name' => $item['name'], 'type' => $item['type'], 'key_' => $item['key_'], 'interfaceid' => $item['interfaceid'], 'delay' => $item['delay'], 'history' => $item['history'], 'trends' => $item['trends'], 'value_type' => $item['value_type'], 'trapper_hosts' => $item['trapper_hosts'], 'units' => $item['units'], 'multiplier' => $item['multiplier'], 'delta' => $item['delta'], 'snmp_community' => $item['snmp_community'], 'snmp_oid' => $item['snmp_oid'], 'snmpv3_securityname' => $item['snmpv3_securityname'], 'snmpv3_securitylevel' => $item['snmpv3_securitylevel'], 'snmpv3_authpassphrase' => $item['snmpv3_authpassphrase'], 'snmpv3_privpassphrase' => $item['snmpv3_privpassphrase'], 'snmpv3_authprotocol' => $item['snmpv3_authprotocol'], 'snmpv3_privprotocol' => $item['snmpv3_privprotocol'], 'snmpv3_contextname' => $item['snmpv3_contextname'], 'formula' => $item['formula'], 'error' => $item['error'], 'lastlogsize' => $item['lastlogsize'], 'logtimefmt' => $item['logtimefmt'], 'templateid' => $item['templateid'], 'valuemapid' => $item['valuemapid'], 'delay_flex' => $item['delay_flex'], 'params' => $item['params'], 'ipmi_sensor' => $item['ipmi_sensor'], 'data_type' => $item['data_type'], 'authtype' => $item['authtype'], 'username' => $item['username'], 'password' => $item['password'], 'publickey' => $item['publickey'], 'privatekey' => $item['privatekey'], 'mtime' => $item['mtime'], 'flags' => $item['flags'], 'filter' => $item['filter'], 'port' => $item['port'], 'description' => $item['description'], 'inventory_link' => $item['inventory_link'], 'lifetime' => $item['lifetime'], 'status' => $item['status']));
    }
}
开发者ID:micromachine,项目名称:RackTables-ZABBIX-bridge,代码行数:10,代码来源:init_racktables.php

示例9: doPost

					Select Image:
				</div>
				<div class="table_right">
					<input type="file" name="file" />
				</div>				
			</div>	
			<div class="table_clear">
				<input type="submit" value="Upload" class="button" />
			</div>				
		</form>
			<?php 
if (isset($_FILES['file'])) {
    if (!file_exists($_FILES['file']['tmp_name'])) {
        echo '<div class="error_message">File was not uploaded properly.</div>';
    } else {
        $mReturn = doPost('photo.addPhoto', array('photo' => '@' . $_FILES['file']['tmp_name'] . ';type=' . $_FILES['file']['type'], 'photo_name' => basename($_FILES['file']['name'])));
        ?>
						<div class="message">Image successfully uploaded and sent to the API server.</div>
						<h3>API Server Output</h3>
						<?php 
        echo '<pre>';
        print_r($mReturn);
        echo '</pre>';
        if (isset($mReturn->output->original)) {
            echo '<h3>Photo Output</h3>';
            foreach ($mReturn->output as $sKey => $sImage) {
                if ($sKey == 'original') {
                    continue;
                }
                echo '<img src="' . $sImage . '" /><br /><br />';
            }
开发者ID:laiello,项目名称:kr-indian,代码行数:31,代码来源:index.php

示例10: updateItem

function updateItem($item)
{
    # parameters
    $item['method'] = 'update_item';
    # response
    return doPost($item);
}
开发者ID:micromachine,项目名称:RackTables-ZABBIX-bridge,代码行数:7,代码来源:racktablesapi.php

示例11: getStats

/**
 * Gets database statistics/information.
 * @param $email login email address at the license portal
 * @param $password password at the license portal
 * @param $dbName name of the new database
 * @return Zend_Http_Response HTTP response
 */
function getStats($email, $password, $dbName)
{
    $postResponse = doPost("getStats.php", array('timeout' => SHORT_OPERATION_TIMEOUT), array('email' => $email, 'password' => md5($password), 'dbName' => $dbName));
    return $postResponse;
}
开发者ID:Mynameisjack2014,项目名称:junaio-quickstarts,代码行数:12,代码来源:metaioCvsHelper.php

示例12: doPost

     for ($i = 0; $i < 5; $i++) {
         if (i > 0) {
             $notify_pushids .= ',';
         }
         $notify_pushids .= $push_array[$i];
     }
 }
 // add the crash data to the database
 if ($crash["logdata"] != "" && $crash["version"] != "" && $crash["applicationname"] != "" && $crash["bundleidentifier"] != "" && $acceptlog == true) {
     // check if we need to redirect this crash
     if ($hockeyappidentifier != '') {
         if (!isset($hockeyAppURL)) {
             $hockeyAppURL = "ssl://beta.hockeyapp.net/";
         }
         // we assume all crashes in this xml goes to the same app, since it is coming from one client. so push them all at once to HockeyApp
         $result = doPost($hockeyAppURL . "api/2/apps/" . $hockeyappidentifier . "/crashes", utf8_encode($xmlstring));
         // we do not parse the result, values are different anyway, so simply return unknown status
         echo xml_for_result(VERSION_STATUS_UNKNOWN);
         /* schliessen der Verbinung */
         mysql_close($link);
         // HockeyApp doesn't support direct feedback, it requires the new client to do that. So exit right away.
         exit;
     }
     // is this a jailbroken device?
     $jailbreak = 0;
     if (strpos($crash["logdata"], "MobileSubstrate") !== false) {
         $jailbreak = 1;
     }
     // Since analyzing the log data seems to have problems, first add it to the database, then read it, since it seems that one is fine then
     // first check if the version status is not discontinued
     // check if the version is already added and the status of the version and notify status
开发者ID:Feng-xp,项目名称:QuincyKit,代码行数:31,代码来源:crash_v200.php

示例13: echoStyle

<?php

include_once 'langList.php';
include_once 'common.php';
echoStyle();
if (isset($_POST['strSource'], $_POST['strDest'])) {
    doPost($_POST['strSource'], $_POST['strDest']);
} elseif (isset($_GET['lang'])) {
    $lang = strtolower($_GET['lang']);
    if ($lang != "") {
        if (!in_array("lang." . $lang . ".php", getLangFiles())) {
            if (preg_match("/^[a-zA-Z0-9_-]*\$/", $lang)) {
                showAddNew($lang);
            } else {
                badData("LANGUAGE (" . $lang . ") HAS INVALID CHARS");
            }
        } else {
            badData("THAT LANGUAGE ALREADY EXISTS");
        }
    } else {
        badData("NO LANGUAGE ENTERED");
    }
} else {
    badData("NO LANGUAGE ENTERED");
}
function doPost($strSource, $strDest)
{
    if (!in_array($strDest, getLangFiles())) {
        if (copy($strSource, $strDest)) {
            iniTable();
            echo "<h1>File created successfully</h1>";
开发者ID:heldersepu,项目名称:php-lang,代码行数:31,代码来源:addnew.php

示例14: array

$headers = array('HTTP_HOST', 'HTTP_USER_AGENT', 'HTTP_ACCEPT', 'HTTP_ACCEPT_LANGUAGE', 'HTTP_ACCEPT_ENCODING', 'HTTP_ACCEPT_CHARSET', 'HTTP_KEEP_ALIVE', 'HTTP_CONNECTION', 'HTTP_CACHE_CONTROL');
$request->method = $_SERVER['REQUEST_METHOD'];
$request->url = $_SERVER['REQUEST_URI'];
$request->host = $_SERVER['HTTP_HOST'];
$request->protocol = $_SERVER['SERVER_PROTOCOL'];
//$request->query    = $_SERVER['QUERY_STRING'];
$request->query = $_GET;
//$request->headers  = processHeaders($headers);
$request->headers = getallheaders();
switch ($request->method) {
    case 'GET':
        doGet($request);
        break;
    case 'POST':
        $request->body = file_get_contents('php://input');
        doPost($request);
        break;
    case 'PUT':
        $request->body = file_get_contents('php://input');
        doPut($request);
        break;
    case 'DELETE':
        doDelete($request);
        break;
    default:
        echo $request->method, " not supported.\n";
        break;
}
function doGet($request)
{
    //echo '<pre>'; print_r($request); echo '</pre>';
开发者ID:royopa,项目名称:php5-http-client,代码行数:31,代码来源:api.php

示例15: echoStyle

<?php

include_once 'langList.php';
include_once 'common.php';
echoStyle();
$iniKey = "public \$";
$iniValue = '"";';
$strKey = $iniKey;
$strValue = $iniValue;
if (isset($_POST['strKey'], $_POST['strValue'])) {
    $strKey = str_replace("\\", "", $_POST['strKey']);
    $strValue = str_replace("\\", "", $_POST['strValue']);
    //Validate
    $strMessage = validate($strKey, $strValue);
    if ($strMessage == '') {
        $strMessage = doPost($strKey, $strValue);
        $strKey = $iniKey;
        $strValue = $iniValue;
    }
}
iniTable();
?>

<h1 align="center">- Select Action -</h1><br>

<strong>1 - Edit Language File:</strong>
<select onchange="location = 'edit.php?lang='+this.options[this.selectedIndex].value;">
    <option value="">Select lang file </option>
    <?php 
foreach (getLangFiles() as $key => $value) {
    echo "<option value=" . $value . ">" . $value . "</option>";
开发者ID:heldersepu,项目名称:php-lang,代码行数:31,代码来源:index.php


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