Good day! Tell me, please, the answer.
There is an input form. The user enters the number in the form. If the number coincided, so that in the database, then we give out: the number is correct. Otherwise, the number is not correct. Question: how to make a warning: "the number is not entered in the field", if the user has not entered a number, and pressed the button "next". Code below.
<? if (empty($_POST['chislo'])) { echo '<form action="?" method="post"><div> Число:<br/><input type="text" name="chislo" maxlength="40" title="Введите число"><br> <input type="submit" value="Проверка" title="Проверка"/></div></form>'; } else{ $chi = intval($_POST['chislo']); //фильтр } else { $chislo = mysql_fetch_assoc(mysql_query("SELECT `ch` FROM `chislo`")); // база. if ($chi == $chislo['ch']) { echo 'число правильное'; } else { echo 'число не правильное'; } } ?>