搞过微信公众平台开发的帮帮小弟啊 感谢了 使用curl把。有个例子 https://github.com/spetacular/weixin/blob/master/weixin.class.php 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 应该如楼上说的使用 curl, jquery的话怎么样在服务器端发起呢?你这个是活的他的授权token应该使用申请账号时的服务器来回调吧?还没去做微信公众账号,不过我猜应该是这个样子的。 是的 必须使用curl curl使用get方法获取远程url的写法真是多样啊 比如下面两个函数,上面的函数无法获取token,而下面的函数则可以获取:function curl_get($url){ //初始化 $ch = curl_init(); //设置选项,包括URL curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_HEADER, 0); //执行并获取HTML文档内容 $output = curl_exec($ch); //释放curl句柄 curl_close($ch); //打印获得的数据 return $output;}function curl_getpost($url, $jsonData="", $type="GET"){ $ch = curl_init($url) ; curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $type); curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonData); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json')); $result = curl_exec($ch) ; curl_close($ch) ; return $result;}curl中的内容太多…… php导出csv问题 新人求助紧急~~~~~~~~~ php购物车 帮我看下对mysql 字符集的总结?php excel写到mysql 参加周末什刹海程序员茶话会!【北京地区】 php分页问题 系统提示未定义变量Undefined variable: php_self mysql数据调用问题 用php3写的程序如何在php4环境下运行?? php高手们,请教一个邮件函数imap_open()的问题,急用 strpos函数 PHP中如何定义变量?
{
//初始化
$ch = curl_init();
//设置选项,包括URL
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
//执行并获取HTML文档内容
$output = curl_exec($ch);
//释放curl句柄
curl_close($ch);
//打印获得的数据
return $output;
}
function curl_getpost($url, $jsonData="", $type="GET"){
$ch = curl_init($url) ;
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $type);
curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonData);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
$result = curl_exec($ch) ;
curl_close($ch) ;
return $result;
}
curl中的内容太多……