Answer the question
In order to leave comments, you need to log in
Why is the form not working properly?
Hello. I am making a website ( csgocamp.pe.hu/wordpress/) on WordPress. And I ran into this problem:
There is a sidebar template that perfectly displays two labels ( <table>
). But the registration form ( <form>
) displays in general in the center, and not in the place of the sidebar. Although I seem to be writing the code in the same place as the other two tables.
Code (sidebar.php, connection to the database and one table specially removed):
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
</head>
<!-- РЕГИСТРАЦИЯ РЕГИСТРАЦИЯ РЕГИСТРАЦИЯ РЕГИСТРАЦИЯ РЕГИСТРАЦИЯ -->
<!-- Форма регистрации -->
<form class="reg" method="post" action="sidebar.php">
<input type="text" name="login" placeholder="Логин" required> <br>
<input type="text" name="mail" placeholder="Почта(Email)" required> <br>
<input type="text" name="password" placeholder="Пароль" required> <br>
<input type="text" name="r_password" placeholder="Повторите пароль" required> <br>
<input type="submit" name="submit">
<?php
if (isset($_POST['submit'])) {
$login = $_POST['login'];
$mail = $_POST['mail'];
$password = $_POST['password'];
$r_password = $_POST['r_password'];
if ($password == $r_password) {
$password = md5($password);
} else {
echo "Пароли не совпадают!";
}
}
?>
</form>
<!-- ТАБЛИЦЫ ТАБЛИЦЫ ТАБЛИЦЫ ТАБЛИЦЫ ТАБЛИЦЫ ТАБЛИЦЫ ТАБЛИЦЫ -->
<table>
<thead>
<tr>
<th>Name</th>
<th>Date</th>
</tr>
</thead>
<tbody>
<?php while ($row = mysqli_fetch_array($result, MYSQLI_BOTH)) { ?>
<tr>
<td> <?php echo $row['TourName']; ?> </td>
<td> <?php echo $row['TourDate']; ?> </td>
</tr>
<?php } ?>
</tbody>
</table>
Answer the question
In order to leave comments, you need to log in
The form is inside the body. Shown on a separate line. That is exactly how it should work.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question