ucenter整合自己网站ucenter整合自己网站
失败是因为你的应用程序的api/uc.php中可能有错误.比如ucenter规定.只有uc.php这个文件正常返回1,才会提示通信成功.但如果你的返回了一个sql错误.而不是1,则一定是提示失败的.怎么测试呢
<?php
include_once “config/config_global.php”;
include_once “config/config_ucenter.php”;
include_once “uc_client/client.php”;
echo uc_user_synlogin(2); //1为用户的ID
?>
<script type=”text/javascript”>
var obj=document.getElementsByTagName(“script”);
for(var i=0;i<obj.length-1;i++) {
document.write(“<a href=”"+obj[i].src+””>”+obj[i].src+”</a><hr>”);
}
</script>
上面的代码保存成test.php文件.放在你的dz论坛或ucenter所在的根目录中,直接用域名.com/test.php 看下有什么提示错误.当然.uc.php文件中
error_reporting(0); 这一句最后先注释掉.错误会更清晰的显示.找到错误后.这一句一定要加上.否则.可能一直通信失败.
本文来自电脑杂谈,转载请注明本文网址:
http://www.pc-fly.com/a/ruanjian/article-35599-1.html
有个叫巴菲特的貌似比你有钱
谢作诗这厮脑袋进水了吧
因为现代战争将没有胜利者