config.php
url拼合代码:
define('BLOGBINDURL',"http://in-o.xianguo.com/sina/blogbind?email=%s&puid=%s&blogurl=%s&action=%s&apikey=%s&time=%s&securitykey=%s"); //测试
url拼合代码:
/**
* 绑定博客
*
* @param string $email 用户邮箱
* @param int $uid 用户uid
* @param string $blogurl 博客url
* @param int $action 操作类型 0 绑定 1 删除
* @return boolean
* 0:失败/1:成功
*/
public function bindblog($email,$uid,$blogurl,$action)
{
$time = time();
$securitykey = md5($uid . BIND_BLOG_APIKEY . $time . BIND_BLOG_PRIKEY);
$url = sprintf(BLOGBINDURL, urlencode($email), urlencode($uid), urlencode($blogurl), urlencode($action), urlencode($apikey), urlencode($time), urlencode($securitykey));
$flag = Check::request($url,$result);
if(1 == $flag) {
$resultReturn = json_decode($result,True);
if(0 === $resultReturn['status'])
return 1;
if(1 === $resultReturn['status'])
return 0;
} else {
return 0;
}
}
* 绑定博客
*
* @param string $email 用户邮箱
* @param int $uid 用户uid
* @param string $blogurl 博客url
* @param int $action 操作类型 0 绑定 1 删除
* @return boolean
* 0:失败/1:成功
*/
public function bindblog($email,$uid,$blogurl,$action)
{
$time = time();
$securitykey = md5($uid . BIND_BLOG_APIKEY . $time . BIND_BLOG_PRIKEY);
$url = sprintf(BLOGBINDURL, urlencode($email), urlencode($uid), urlencode($blogurl), urlencode($action), urlencode($apikey), urlencode($time), urlencode($securitykey));
$flag = Check::request($url,$result);
if(1 == $flag) {
$resultReturn = json_decode($result,True);
if(0 === $resultReturn['status'])
return 1;
if(1 === $resultReturn['status'])
return 0;
} else {
return 0;
}
}
作者:jackxiang@向东博客 专注WEB应用 构架之美 --- 构架之美,在于尽态极妍 | 应用之美,在于药到病除
地址:https://jackxiang.com/post/1682/
版权所有。转载时必须以链接形式注明作者和原始出处及本声明!
评论列表