解析错误:语法错误,意外'}'在第26行的C:\ xampp \ htdocs \ eifel \ register.php中

时间:2014-07-10 14:39:55

标签: php mysql

此代码有什么问题。我一直收到上面标题上的消息!错误是:

解析错误:第26行的C:\ xampp \ htdocs \ eifel \ register.php中的语法错误,意外'}'

我真的不知道该做什么!第26行的所有内容都是大括号! 解析错误:语法错误,第26行的C:\ xampp \ htdocs \ eifel \ register.php中的意外'}'

<html>
<head>
<title>Eiffel IM-Register</title>
</head>
<body>
<?php include "connect.php"; ?>

<?php include "functions.php"; ?>

<?php include "title_bar.php"; ?>

<div>
<h3>Register for an Eiffel Account</h3>
<p>You don't need to register if you already have a YQPCID!</p>
<form method='post'>
<?php
if(isset($_POST['register'])){
    $username = $_POST['username'];
    $password = $_POST['password'];
    if(empty($username) or empty ($password)){
            $message = "Error: Fields Empty!";
    } 
    else {
            mysql_query("INSERT INTO 'users' VALUES('','$username','$password')");
            $message = "Successfully Registered !"
    }

    echo "<p>$message</p>";


}
?>

<form method= 'post'>
Username : <br/>
<input type='text' name='username' />
<br/><br/>
Password : <br/>
<input type='password' name='password' />
<br/><br/>
<input type='submit' name='register 'value='Register' />
</form>
</div>
</body>
</html>

谢谢, User123!

1 个答案:

答案 0 :(得分:0)

你的分号丢失了。

$message = "Successfully Registered !"

应该是:

$message = "Successfully Registered !";
相关问题