Web 分类中的最新日记

rpxnow.com的OpenID托管服务

| 评论(2)


RPX提供了OpenID的托管服务,你所要做的,只是在网页中插入几行代码,剩下的全部由它来完成。

但是RPX提供的PHP示例代码,我想很多人未必会用,写的有点菜,我就没有用的起来。下面是我自己写的一个示例代码,供大家学习:)

<script src="https://rpxnow.com/openid/v2/widget"
type="text/javascript"></script>
<script type="text/javascript">
RPXNOW.token_url = "http://freebapp.org/tools/openid/rpx.php";
RPXNOW.realm = "freebapp";
RPXNOW.overlay = true;
RPXNOW.language_preference = 'en';
</script>

<?php
if(!empty($_REQUEST['token'])){
$post['token'] = $_REQUEST['token'];
$post['apiKey'] = 'a21e795ea614c12f549660ab15f93de30451d338';
$post['format'] = 'json';

$curl = curl_init();
$url = 'https://rpxnow.com/api/v2/auth_info?token_url='.urlencode('http://freebapp.org/tools/openid/rpx.php');
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_HEADER, 0);
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_POSTFIELDS, $post);
curl_setopt($curl, CURLOPT_URL, $url);

$data = curl_exec($curl);
echo('<pre>');
print_r(json_decode($data));
echo('</pre>');
curl_close($curl);
}
?>

大家把上例的apiKey和token_url换成自己的就可以了!

示例演示

农历源代码及演示

本程序从JavaScript版修改过来。由于PHP时间限制原因:

有效的时间戳典型范围是格林威治时间 1901 年 12 月 13 日 20:45:54 到 2038 年 1 月 19 日 03:14:07。(此范围符合 32 位有符号整数的最小值和最大值)。在 Windows 系统中此范围限制为从 1970 年 1 月 1 日到 2038 年 1 月 19 日。
起始和结束的时间看系统时间。

演示

下载

Yesterday evening

Yesterday evening, before hitting the asphalt back home, I visited the AH store beneath the parking-lot, where these two young people, armed with a video-camera and blossoming smiles, tried to capture passers-by.
Normally I would prefer having my head chopped off before ... errr ... .
She didn't have any pigtails, but ... well ... you know, there was a welcoming sight - countenance and appearance!
She did have that kind of 'Lonneke Engel' pinnule and posture. Not at all that perfect, so perchance even more graceful!



Reflecting on the subject I told them I really wasn't the man they wanted. They acceded this truth quickly enough but we kept chatting for a while - both guy and girl very relaxed, noticeably enjoying their little project.

They probably have wiped this Ugly Faustus Face already, for all that
Mr Wang

王炜,现在福建泉州从事 B2C 电子商务。爱好编程,业余时间在 FreeBSD / Apache / PHP / PostgerSQL 平台开发 B/S 架构的免费软件。

Follow Google Buzz Twitter Facebook Sina

收藏王炜's Blog

Bookmark and Share

关于此归档

这里是分类Web中的最新日记。

上一个分类Servers

下一个分类Work

首页归档页可以看到最新的日记和所有日记。