Home >Backend Development >PHP Tutorial >请大神们看看 为什么小弟我的$act接受到的值是delmes 但是不能执行elseif后面的语句

请大神们看看 为什么小弟我的$act接受到的值是delmes 但是不能执行elseif后面的语句

WBOY
WBOYOriginal
2016-06-13 12:25:111063browse

请大神们看看 为什么我的$act接受到的值是delmes 但是不能执行elseif后面的语句?
$act=$_REQUEST['act'];
$username=$_REQUEST['username'];
$title=$_REQUEST['title'];
$content=$_REQUEST['content'];
$profile=$_REQUEST['profile'];
$ip=$_SERVER['REMOTE_ADDR'];
$date=date("Y-m-d H:i:s",time());
$id=$_REQUEST['id'];
echo $act,$id;

if ($act=="doaction"){
$filename="messages.txt";
if(file_exists($filename)){
$str=file_get_contents("messages.txt");
$array=unserialize($str);
}
$array[]=compact("username","title","title","content","profile","ip","date");
file_put_contents("messages.txt", serialize($array));
}
elseif($act=="delmes"){
echo “1111”;
}
------解决思路----------------------
那页面输出的是什么?

你最好 var_du,p($_REQUEST); 看一下究竟传入了什么
------解决思路----------------------
var_dump($act); 看看是什么值

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn