<?php
header('content-type:text/html;charset=utf-8');
if(isset($_post['submit'])){
$username = $_post['username'];
$password = $_post['password'];
if(empty($username)||empty($password)){
header('Refresh:3 ;url=login.php');
echo '用户名密码不能为空';
exit;
}
}else{
include_once 'templates/login.html';
}
?>
找出问题了,是php的变量没注意区分大小写