我用的是wampserver這個來啟動的但是為什么頁面上看不到輸出的信息
http://192.168.0.107/app/index.php? 這個是地址?
代碼:
<?php
namespace Home\Controller;
use Think\Controller;
class IndexController extends Controller {
?
??? public function index(){
??? ??$nonce =$_GET['nonce'];
??? ??$token ='weixin';
??? ??$timestamp=$_GET['timestamp'];
??? ??$echostr=$_GET['echostr'];
??? ??$signature=$_GET['signature'];
??? ??$array =array();
??? ??$array =array($nonce,$timestamp,$token);
??? ??sort($array);
??? ??$str=sha1(implode($array));
??? ??if(?$str==$signature && $echostr){
??? ???//第一次接入微信API接口的時候才會驗證合法性
??? ????echo $echostr;
??? ????echo 'weixin001';
??? ????exit;
??? ??}
??? ???
??? }
???
??? public function show(){
??? ?echo 'weixin';?
??? ?
??? }???
}
這個頁面上什么都不出來
2016-02-17
你試試 http://192.168.0.107/app/index.php/index/show,這樣應(yīng)該就出來了