亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定

關于使用$_GET[]獲取變量問題

按照老師的方法做了入口函數,但是結果通過Url無法接收到參數。

如圖:

547fd8af0001685b05000135.jpg

代碼如下:

require_once ('function/MVCFunction.php');
?require_once ('function/StrFunction.php');

/**
?* Step 1:設置控制器白名單和方法白名單
?*/
?$controller_Allow=array('test');
?$method_Allow=array('show');
?
/**
?* Step 2: 從統一的Url中接收參數
?* 統一Url:? index.php?controller=控制器名&method=方法名
?*/

?$controller_1=$_GET['controller'];
?$method_1=$_GET['method'];
?$controller=in_array(fpfaddslashes($_GET['controller']),
??? ??? ? $controller_Allow);
?$method=in_array(fpfaddslashes($_GET['method']),
???????? $method_Allow);


?echo "your input controller:".$controller."<br />";
?echo "your input method:".$method."<br />";
?echo "your input controller_1:".$controller."<br />";
?echo "your input method_1:".$method."<br />";

正在回答

2 回答

$controller=in_array(fpfaddslashes($_GET['controller']),$controller_Allow);

你使用的in_array 函數的返回值是 true 和? false 所以 你賦值給 $controller的 實際上是 true 和 false?

0 回復 有任何疑惑可以回復我~

哦,謝謝老師指正錯誤

0 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消

關于使用$_GET[]獲取變量問題

我要回答 關注問題
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號