当我尝试使用错误的凭据提交登录时,页面加载错误的 css 样式。如果用户有活动帐户,我会签入 index.php,如果没有,我会包含 login.php 页面。当我删除顶部的 php 时,我没有收到任何错误,并且页面位于正确的 css 中。因此,总是在出现错误时,页面看起来与设计完全不同。也许浏览器不加载css?还是完整的CSS?
<?php
// show negative messages
if ($account->errors) {
foreach ($account->errors as $error) {
echo $error;
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<!-- INITIALISE -->
<meta charset="utf-8">
<title>Sign in</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<!-- STYLESHEETS -->
<link href="css/bootstrap.css" rel="stylesheet">
<link href="css/bootstrap-responsive.css" rel="stylesheet">
<link href="css/main.css" rel="stylesheet" >
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="js/html5shiv.js"></script>
<script src="js/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="form-wrapper text-center">
<hr>
<form class="form-signin" role="form" action="index.php" name="loginform" method="post">
<h2 class="form-signin-heading">log in.</h2>
<input type="text" class="input-block-level" name="posted_username" placeholder="User">
<input type="password" class="input-block-level" name="posted_password" placeholder="Pass">
<button class="btn btn-small btn-danger" type="submit" name="login">Log in</button>
</form>
</div> <!-- /form-wrapper -->
<!-- BOOTSTRAP -->
<script src="js/jquery.js"></script>
<script src="js/bootstrap.js"></script>
</body>
</html>