我是一個編程和PHP的完全新手,我的代碼拋出一個錯誤,說有一個意外的結束的文件,我不能爲我的生活看到什麼是缺少的或那裏不應該是。任何人都可以發現它?PHP解析錯誤 - 意外的文件結尾
<html>
<head>
<title><?php echo $firstname; ?> <?php echo $lastname; ?>'s Profile</title>
</head>
<body>
<?php
if (isset($_GET['username'])){
\t $username = $_GET['username'];
mysql_connect("localhost","root", "") or die ("Could not connect to the server");
mysql_select_db("users") or die ("That database could not be found.");
\t $userquery = mysql_query("SELECT * FROM users WHERE username='$username'") or die ("The query could not be completed, please try again later.");
\t if(mysql_num_rows($userquery) !=1){
\t \t die ("That user could not be found.");
\t }
\t while($row = mysql_fetch_array($userquery, MYSQL_ASSOC)) {
\t \t $firstname = $row['firstname'];
\t \t $lastname = $row['lastname'];
\t \t $email = $row['email'];
\t \t $dbusername = $row['dbusername'];
\t \t $access = $row['access'];
\t \t }
\t \t if($username != $dbusername){
\t \t \t die ("There has been a fatal error, please try again."); \t \t
\t \t }
\t
\t \t if($access == 1) {
\t \t \t $access = "Level 1 User";
\t \t } else
\t \t \t if($access == 2) {
\t \t \t \t $access = "Level 2 User";
\t \t \t } \t else
\t \t \t \t \t if($access == 3) {
\t \t \t \t \t \t $access = "Level 3 User";
\t \t \t \t \t } else
\t \t \t \t \t \t if($access == 4) {
\t \t \t \t \t \t \t $access = "Administrator.";
\t \t \t \t \t \t } else die ("This user has an access level beyond the realms of possibility. Beware.");
\t
\t \t \t \t \t
?>
<h2><?php echo $firstname; ?> <?php echo $lastname; ?>'s Profile</h2><br />
<table>
\t <tr><td>Firstname:</td><td><?php echo $firstname; ?></td></tr>
<tr><td>Lastname:</td><td><?php echo $lastname; ?></td></tr>
<tr><td>email:</td><td><?php echo $email; ?></td></tr>
\t <tr><td>dbusername:</td><td><?php echo $dbusername; ?></td></tr>
\t <tr><td>access:</td><td><?php echo $access; ?></td></tr>
</table>
</body>
</html>
哪裏while循環結束? – Jocelyn 2014-10-19 06:00:28