<?php session_start() && error_reporting(0); header("Content-type: text/html; charset=utf-8"); require './include/db.php'; if($_SERVER['REQUEST_METHOD']=="POST"){ $validate=""; $username = guolv($_POST['username']); $password = guolv($_POST['password']); $password = md5(crypt($password,substr($password,0,2))); $yzm = guolv($_POST["validate"]); if(isset($yzm)){ $validate=$yzm; if($validate!=$_SESSION["authnum_session"]) { $zt = "<font color=red>验证码不对</font>"; echo "<script>alert('验证码不对!');window.history.go(-1);</script>";exit; session_destroy();//清除 } else { $result=mysql_query("SELECT * FROM wq_user where username='$username' and password='$password' and y=1"); $num=mysql_num_rows($result); if($num<1) { $zt = "<font color=red>用户名或密码错误</font>"; echo "<script>alert('用户名或密码错误!');window.history.go(-1);</script>";exit; } else { date_default_timezone_set("PRC"); $time=date("Y-m-d H:i:s", time()); $ip=ip(); mysql_query("update wq_user set lastloginip=loginip,loginip='$ip',lastlogintime=logintime,logintime='$time' where username='$username'"); $_SESSION['username'] = $username; setcookie("name","dsms"); if($url<>"") { echo "<script> window.location.href='".$url."';</script>"; } else { echo "<script> window.location.href='./';</script>"; } } } } } ?> <!doctype html> <html class="x-admin-sm">
이 PHP 코드에 문제가 있나요? 웹페이지를 제거하고 웹페이지 앞에 PHP 코드를 추가하면 왜 웹페이지가 표시되지 않습니까? 오류: 500이 표시됩니다. if 문이 잘못된 경우 알려주세요.