execute">
时间:2021-07-01 10:21:17 帮助过:16人阅读
prepare("select name,password,loginnumber,loginstatus from nasdaouser where name=? and password=?");$selectUser->execute(array($name,$md5PD));$userNum=$selectUser->rowCount();$res=$selectUser->fetch();if($userNum==1){ loginSuecess($name,$res,$md5PD); }else { Msg($functionName); }}//登录成功function loginSuecess($name,$res,$md5PD){$functionName='';$functionName=0;global $dbc,$user_ip,$time;$loginlog=$dbc->prepare("insert into loginlog (name,password,ip,logintime,status,loginstatus) values(?,?,?,?,?,?)");$loginlog->execute(array($name,$md5PD,$user_ip,$time,'0','0'));$userLogin=$dbc->prepare("update nasdaouser set endlogintime=? where name=?");$userLogin->execute(array($time,$name));Msg($functionName);}function Msg($functionName){ echo $functionName; switch($functionName){ case "emptyloginnull": echo "不要调戏我好吗?系统也会数数的,你根本没有输入帐号与密码!!!"; break; case 0: echo "登录成功!"; break; case 1: echo "登录失败,请检查帐号密码是否输入错误!"; }}?>
function Msg($functionName){ print_r(debug_backtrace()); //观察一下是谁调用的、参数是什么 switch($functionName){ ..... }}
function Msg($functionName){ print_r(debug_backtrace()); //观察一下是谁调用的、参数是什么 switch($functionName){ ..... }}
Array ( [0] => Array ( [file] => C:\wamp\www\mjshu\login.php [line] => 40 [function] => Msg [args] => Array ( [0] => 1 ) ) [1] => Array ( [file] => C:\wamp\www\mjshu\login.php [line] => 19 [function] => loginSQL [args] => Array ( [0] => smj227227 [1] => Password ) ) [2] => Array ( [file] => C:\wamp\www\mjshu\login.php [line] => 11 [function] => emptyloginnull [args] => Array ( [0] => smj227227 [1] => Password ) ) ) 登录失败,请检查帐号密码是否输入错误!
function Msg($functionName){ print_r(debug_backtrace()); //观察一下是谁调用的、参数是什么 switch($functionName){ ..... }}
Array ( [0] => Array ( [file] => C:\wamp\www\mjshu\login.php [line] => 52 [function] => Msg [args] => Array ( [0] => 0 ) ) [1] => Array ( [file] => C:\wamp\www\mjshu\login.php [line] => 35 [function] => loginSuecess [args] => Array ( [0] => smj227227 [1] => Array ( [name] => smj227227 [0] => smj227227 [password] => b9f94ff142c0d6da23543e4e37e04ac9 [1] => b9f94ff142c0d6da23543e4e37e04ac9 [loginnumber] => [2] => [loginstatus] => 0 [3] => 0 ) [2] => b9f94ff142c0d6da23543e4e37e04ac9 ) ) [2] => Array ( [file] => C:\wamp\www\mjshu\login.php [line] => 19 [function] => loginSQL [args] => Array ( [0] => smj227227 [1] => 227227 ) ) [3] => Array ( [file] => C:\wamp\www\mjshu\login.php [line] => 11 [function] => emptyloginnull [args] => Array ( [0] => smj227227 [1] => 227227 ) ))不要调戏我好吗?系统也会数数的,你根本没有输入帐号与密码!!!
var_dump(0 == "emptyloginnull");bool(true)
var_dump(0 == "emptyloginnull");bool(true)