<?php
include('conection.php');
if (isset($_POST['submit']))
{
$username = trim($_POST['username']);
$password = sha1(trim($_POST['password']));
$query = "INSERT INTO users (username, password)
VALUES('($username)', '($password)')";
$result = mysql_query($query);
if ($result)
{
$message="Поздравляем с успешной регистрацией!";
}
else{
$message ="При регистрации произошла ошибка!";
}
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
<link rel="stylesheet" href="style.css">
<title>Регистрация на сайте</title>
</head>
<body>
<div id="header"><p>MyCompany.com</p></div>
<hr>
<?php
if (!empty($message)){echo "<p class='ang'>".$message."</p>";
echo"<p>Для входа на сайт жмите<a href='login_us.php'>Сюда</a>";}
?>
<form method="post" action="registr.php" >
<fieldset id="personal_information">
<ol>
<li>
<label for="name" id="labelNam">Your name:</label>
<input type="text" name="name" id="name" placeholder="Введите ваше имя" required>
</li>
<li>
<label for="password">Password:</label>
<input type="text" name="pass" id="pass" placeholder="Введите пароль" required>
<li>
<input id="sub" type="submit" value="Зарегистрироваться">
</li>
</ol>
</fieldset>
</form>
<p id="account"><a href="login_us.php"><strong>Войти под своей учетной записью</strong></a></p>
</body>
</html>
Помогите решить проблему. Может кто увидит ошибку. Не судите строго я только начинаю в PHP.