douzuqin3467 2015-06-01 20:07
浏览 49

页面显示空白但代码中有内容? [关闭]

My page is showing just a white page with no content but the code specifically shows content. Please note that it only happened when there was PHP in the form but that's needed for the system to work.

<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>
  • 写回答

1条回答 默认 最新

  • doudou5101 2015-06-01 20:12
    关注

    The two main errors you have are as follows:

    1. You closed your if statement with a semi-colon. Remove the semi-colon.
    2. You have an extra quote in echo "<p>Successfully Registered!"</p>". Remove the middle quote and it will work.

    As I said previously, look at your PHP errors. They will tell you exactly what is wrong.

    评论

报告相同问题?

悬赏问题

  • ¥15 组策略中的计算机配置策略无法下发
  • ¥15 机器学习简单问题解决
  • ¥15 如何绘制动力学系统的相图
  • ¥15 对接wps接口实现获取元数据
  • ¥20 给自己本科IT专业毕业的妹m找个实习工作
  • ¥15 用友U8:向一个无法连接的网络尝试了一个套接字操作,如何解决?
  • ¥30 我的代码按理说完成了模型的搭建、训练、验证测试等工作(标签-网络|关键词-变化检测)
  • ¥50 mac mini外接显示器 画质字体模糊
  • ¥15 TLS1.2协议通信解密
  • ¥40 图书信息管理系统程序编写