Доброго времени суток.
Возникла проблема в которой проблема побеждает, помогите пожалуйста.
Проблема состоит в том что в моем HTML файле есть указатель на форму PHP, но при запуске HTML кода, PHP форма не заполняется
<!DOCTYPE html>
<html>
<head>
<title>Form</title>
</head>
<body>
<h1 align="center"> Форма регистрации </h1>
</body>
<body>
<form id="auth" action="action.php" method="post" >
<h1
<table align="center" Border=180 width="100px" height="80px">
<tr>
<td align="center" width="450px" height="30px"> Имя: <input align="center" id="name" type="name" name="name" form="auth" /> </td> <br>
</tr>
<tr>
<td align="center" width="450px" height="30px"> Фамилия: <input align="center" type="text" name="surname" form="auth"/> </td> <br>
</tr>
<tr>
<td align="center" width="450px" height="30px"> Ваш Пороль: <input align="center" type="password" type="text" name="phone" form="auth"/>
</tr>
<td align="center" width="450px" height="30px"> <input align="center" type="password" type="text" name="phone" form="auth"/> </td> <br>
</tr>
<!--
<tr>
<form method="post" name="formZ" id="formZ" action="">
<fieldset>
<input type="password" name="passwordX" id="passwordX" /> <br>
<input type="password" name="passwordY" id="passwordY" /> <br>
<input type="submit" value="submit" id="submit">
</fieldset>
</form>
</tr>
-->
<tr>
<td width="450px" height="30px">
<p> Укажите Ваш пол: </p>
<input type="radio" name="s" value="m" form="auth" /> Мужской<br>
<input type="radio" name="s" value="f" form="auth" /> Женский
</td>
</tr>
<tr>
<td width="450px" height="30px">
<p>
<label for="date">Дата рождения: </label>
<input type="date" id="date" name="date" form="auth"/>
</p>
</tr>
</td>
<tr>
<td align="center" width="450px" height="30px"> Email: <input align="center" type="email" name="email" form="auth"/> </td> <br>
</tr>
<tr>
<td align="center" width="450px" height="30px"> <br> Сфера интересов: <input align="center" type="text" name="Area_of_interest" form="auth"/> <br> </td>
</tr>
<!--<tr>
<td align="center" width="450px" height="30px"> <br> Кнопка очистки:
<button type="submit"/>Очистить</button> <br>
</tr>
-->
<input type="submit">
</h1>
</form>
</body>
</html>
код HTML
<?php
/* Осуществляем проверку вводимых данных и их защиту от враждебных
скриптов */
$name = htmlspecialchars($_POST['name']);
$surname = htmlspecialchars($_POST['surname']);
$phone = htmlspecialchars($_POST['phone']);
$messages = htmlspecialchars($_POST['messages']);
$s = htmlspecialchars($_POST['s']);
$s = htmlspecialchars($_POST['s']);
$date = htmlspecialchars($_POST['date']);
$email = htmlspecialchars($_POST['email']);
$Area_of_interest = htmlspecialchars($_POST['Area_of_interest']);
/* Устанавливаем e-mail адресата */
$myemail = '[email protected]';
/* Проверяем заполнены ли обязательные поля ввода, используя check_input
функцию */
$name = check_input($_POST['name'], "Имя:");
$surname = check_input($_POST['surname'], "Фамилия:");
$phone= check_input($_POST['phone'], "Ваш Пороль:");
$s = check_input($_POST['s'], "Укажите Ваш пол:");
$s = check_input($_POST['s'], "Укажите Ваш пол:");
$date = check_input($_POST['date'], "Дата рождения:");
$email = check_input($_POST['email'], "Email:");
$Area_of_interest = check_input($_POST['Area_of_interest'], "Сфера интересов:");
?>
<?php
/* Если при заполнении формы были допущены ошибки сработает
следующий код: */
function check_input($data, $problem = "")
{
$data = trim($data);
$data = stripslashes($data);
$data = htmlspecialchars($data);
if ($problem && strlen($data) == 0)
{
show_error($problem);
}
return $data;
}
function show_error($myError)
{
?>
<html>
<body>
<p>Пожалуйста исправьте следующую ошибку:</p>
<?php echo $myError; ?>
</body>
</html>
<?php
exit();
}
?>
код PHP
Подскажите пожалуйста что не так.