Answer the question
In order to leave comments, you need to log in
When entering information from a form on a site in mysql, an extra entry appears, how to remove it?
there is a submission form
<form method="post" class="form">
<div class="pr-title">
Добавить участок
<span class="close" onclick="setVisibility('pre', 'none')">×</span>
</div>
<div style="text-align: center;">
<p>
<label>Участковая избирательная комиссия №</label>
<input type="text" class="input1" name="id">
</p>
<p>
<label>Место нахождения</label></p>
<p>
<input type="text" class="input2" name="name"></p>
<p><label>Адрес</label></p>
<p>
<input type="text" class="input3" name="town" placeholder="город">
<input type="text" class="input4" name="street" placeholder="улица">
<input type="text" class="input5" name="house" placeholder="дом">
<p><input class="subpre" name="sub" type="submit" value="Добавить"/></p>
</div>
</form>
<?php
@$id = @$_POST['id'];
@$name = @$_POST['name'];
@$town = @$_POST['town'];
@$street = @$_POST['street'];
@$house = @$_POST['house'];
@$spec = mysqli_fetch_assoc(@$spec);
$mysqli->query("INSERT INTO `precinct` (`id`, `name`, `town`, `street`, `house`) VALUES ('$id', '$name', '$town','$street', '$house')");
?>
Answer the question
In order to leave comments, you need to log in
I suspect that your form handler is located in the "controller" of the page with the form, and every time you open it, you write empty data, from which there was no POST request.
They get smothered by suppressing errors, and then they run to the forums for help -_-
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question