+ -
当前位置:首页 → 问答吧 → 有关新浪微博api接口测试问题(php)

有关新浪微博api接口测试问题(php)

时间:2011-08-15

来源:互联网

我是一名学生,最近在作新浪微博api的接口测试。初学php,被错误弄得头昏脑胀。但遇到的问题几乎是一样的,郁闷了好几天,比如在做access_token接口测试时。代码如下:
session_start();
 include_once('weibooauth.php');
 include_once('config.php');
 include_once('authorize.php');
 include_once('request_token.php');
 //oauth/access_token

$o = new WeiboOAuth( WB_AKEY ,
  WB_SKEY ,
  $_SESSION['keys']['oauth_token'] ,
  $_SESSION['keys']['oauth_token_secret'] );

$last_key = $o->getAccessToken( $_REQUEST['oauth_verifier'] ) ;
echo($last_key['oauth_token']);

运行后错误提示:
527e0b6ad8350c2332ef6103d1798bdf : a0bcbc2154bf9b5475e4356f33b24365
Notice: Undefined index: keys in D:\wamp\www\weibointerfacetest\access_token.php on line 17

Notice: Undefined index: keys in D:\wamp\www\weibointerfacetest\access_token.php on line 18

Notice: Undefined index: oauth_verifier in D:\wamp\www\weibointerfacetest\access_token.php on line 20

Notice: Undefined index: oauth_token in D:\wamp\www\weibointerfacetest\weibooauth.php on line 1613

Notice: Undefined index: oauth_token_secret in D:\wamp\www\weibointerfacetest\weibooauth.php on line 1613

Notice: Undefined index: oauth_token in D:\wamp\www\weibointerfacetest\access_token.php on line 21

错误均为变量未定义。但是在include包含的文件中变量都做了定义的。为什么会出现这种情况,请也在做新浪微博方面的大虾帮忙解答,谢谢

作者: xuweijia1314   发布时间: 2011-08-15

17行 18行 这些行的代码是什么

作者: ihefe   发布时间: 2011-08-15

热门下载

更多