Answer the question
In order to leave comments, you need to log in
And again about checking for empty (unfilled) fields
Colleagues, there is a script for sending data (mail).
The main part of the code: pastebin.com/53fKyw91
I want to check if the fields are filled in (i.e. if it is not filled out, no information is sent and information is displayed).
I do this: pastebin.com/70bgqLfv - nothing works ...
Direct me on the right path and do not blame me for such a question!
Thanks to!
Answer the question
In order to leave comments, you need to log in
The first thing that came to hand:
$err = "";
if (strlen($_POST['name']) <= 0) {
$err .= "<p>Заполните поле 'Имя'</p>";
}
if (strlen($_POST['subj']) <= 0) {
$err .= "<p>Заполните поле 'Тема'</p>";
}
if (strlen($_POST['msg']) <= 0) {
$err .= "<p>Заполните поле 'Текст сообщения'</p>";
}
if (strlen($err) > 0)
{
print ("<center>Ошибка! $err
<INPUT TYPE='button' VALUE='НАЗАД' onClick='history.go(-1)'>");
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question