本文整理汇总了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";
}