我的页面只显示没有内容的白页,但代码专门显示了内容。请注意,它只发生在表单中有PHP但系统需要工作时才会发生。
<html>
<head>
<title>Register - Admin Panel</title>
</head>
<body>
<?php include 'connect.php'; ?>
<?php include 'functions.php'; ?>
<?php include 'title_bar.php'; ?>
<h3>Register Here : </h3>
<form method='post'>
<?php
if (isset($_POST['submit'])){
$username = $_POST['username'];
$password = md5($_POST['password']);
if (empty($username) or empty($password));{
echo "<p>Fields Empty</p>";
}else {
mysql_query("INSERT INTO user VALUES('', '$username', '$password', '2', '')");
echo "<p>Successfully Registered!"</p>";
}
}
?>
User Name: <br/>
<input type='text' name='username' />
<br/><br/>
Password: <br/>
<input type='password' name='password' />
<br/><br/>
<input type='submit' name='submit' value='Register' />
</form>
</body>
</html>
答案 0 :(得分:2)
您遇到的两个主要错误如下:
"<p>Successfully Registered!"</p>"
中有一个额外的引用。删除中间引号,它将起作用。正如我之前所说,看看你的PHP错误。他们会告诉你到底出了什么问题。