【发布时间】:2014-04-18 16:40:42
【问题描述】:
<?php
session_start();
?>
<!DOCTYPE html>
<html>
<head>
<title>MechRook</title>
<link type="text/css" rel="stylesheet" href="css.css"/>
<link type="image/jpeg" rel="short icon" href="favicon.jpg"/>
</head>
<body>
<div id="fheader">
<h1>Account</br></h1>
<?php
$form = '<form method="post" action="index.php">
Username: <input name="user" type="text"></br>
Password: <input name="pass" type="password"></br>
<input name="btn" type="submit" value="Login">
</form>';
if ($_POST['btn']) {
$user = $_POST['user'];
$pass = $_POST['pass'];
if ($user) {
if($pass) {
echo "$user - $pass <hr> $form";
}
else {
echo "You must enter your password. $form";
}
else {
echo "You must enter your username. $form";
}
}
else {
echo $form;
}
?>
<h2>Account:</br><?php echo $_POST['user']; ?></h2>
</div>
<div id="sheader">
<h1 style="font-size:50px">MechRook</h1>
<section id="con">
<div class="button">
<a href="index.html" class="link">Home</a>
</div>
<div class="button">
<a href="account.html" class="link" style="font-size:15px">Account</a>
</div>
<div class="button">
<a href="contact.html" class="link">Contact</a>
</div>
</section>
<h2>
</br></br>Welcome to MechRook
</h2>
<p>
Welcome to MechRook! MechRook is currently nothing. Wow what a waste of a URl, you might think that but you will see. My friends and I have big plans for MechRook. We have multiple designers for website templates and coders.
</p>
</div>
</body>
</html>
它给了我一个 500 错误。我正在尝试制作表格!请帮忙!告诉我我能做什么。谢谢!________________________________________________________________________________________________________________
【问题讨论】:
-
1. Enable error reporting 看看它是否改变了什么。 2. 检查您的服务器日志。
-
在此语句后缺少右大括号 (
}):echo "You must enter your username. $form";。 -
等待我认为我修复了它,但它仍然给我一个错误:Internal Server Error 服务器遇到内部错误或配置错误,无法完成您的请求。请联系服务器管理员以告知错误发生的时间以及您可能所做的任何可能导致错误的事情。服务器错误日志中可能提供有关此错误的更多信息。 mechrook.com 上的 Web 服务器