after I press submit button page will automatically reloads before I store that input variable to database and if that inputted variable will equal 'sunny'
then this form wont show again. So basically if I submit input text with 'sunny'
inside then I won't be able to see it again. I have tried to place header()
function inside isset()
function but I got error due during reload..
//2. We pick from database weather which eqauals to sunny and assign it to variable $weather
$weather = '';
if (weather != 'sunny') {
echo "<form method='post'>";
echo "<input type='text' name='weather' required />";
echo "<input type='submit' name='submit' value='SEND' />";
echo "</form>";
}
if (isset($_POST['weather'])) {
$_POST['weather'] //1. This variable equals sunny and we store it to database
}