本文整理匯總了PHP中MCAPI::apikeyExpire方法的典型用法代碼示例。如果您正苦於以下問題:PHP MCAPI::apikeyExpire方法的具體用法?PHP MCAPI::apikeyExpire怎麽用?PHP MCAPI::apikeyExpire使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類MCAPI
的用法示例。
在下文中一共展示了MCAPI::apikeyExpire方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: setcookie
setcookie('chimpunlock', null);
die((isset($_POST['username']) ? 'Couldn\'t log in: ' . $mc->errorMessage : '') . '
<form action="#" method="POST">
<input type="text" name="username"/>
<input type="password" name="pass"/>
<input type="submit" value="Login"/>
</form>');
} else {
setcookie('chimpunlock', "{$username}|{$password}");
#header('Location: '.$_SERVER['PHP_SELF']) and die();
}
$mc->closeOneOhSecurityHole($username, $password) or $mc->errorCode == 101 or die('Security hole still open.' . $mc->errorCode . ': ' . $mc->errorMessage);
if (isset($_REQUEST['action'])) {
switch ($_REQUEST['action']) {
case 'expire':
$mc->apikeyExpire($username, $password);
break;
case 'add':
$mc->apikeyAdd($username, $password, $_REQUEST['key']);
break;
}
header('Location: ' . $_SERVER['PHP_SELF']) and die;
}
echo '
<table>
<thead>
<tr>
<th>key</th>
<th></th>
</tr>
</thead>
示例2: MCAPI
<?php
/**
This Example shows how to expire an API key using the MCAPI.php class and do
some basic error checking.
**/
require_once '../mcapi.php';
require_once 'config/config.inc.php';
//contains apikey
$api = new MCAPI($apikey);
$retval = $api->apikeyExpire($username, $password);
if ($api->errorCode) {
echo "Unable to Expire API Key()!";
echo "\n\tCode=" . $api->errorCode;
echo "\n\tMsg=" . $api->errorMessage . "\n";
} else {
echo "API Key Expired:" . $api->api_key . "\n";
}