Za pomocą $_GET pobieram dane i dodaję do bazy. Po czym przekierowuję na tę samą stronę, by uniknąć ponownego użycia tego samego linka. Chcę wyświetlić komunikaty po tym fakcie, ale nie wiem, jak mam ominąć problem wyświetlenia przy stanie początkowym. Oto kod:
$send = (isset($_GET['send'])) ? mysqli_real_escape_string($con, $_GET['send']) : '';
$drop = (isset($_GET['drop'])) ? mysqli_real_escape_string($con, $_GET['drop']) : '';
$a = (isset($_GET['a'])) ? mysqli_real_escape_string($con, $_GET['a']) : NULL;
$e1 = (isset($_GET['e1'])) ? mysqli_real_escape_string($con, $_GET['e1']) : '';
if (isset($a) && $a == 'e1') {
$sql = "UPDATE tabela SET error1=IF(error1='1', '0', '1') WHERE id='".$drop."'";
mysqli_query($con, $sql);
header('Location: history.php?send=1');
}
if (isset($send) && $send == 1) {
$msgs = '
<div class="alert alert-warning message"><a href="#" class="close" data-dismiss="alert">×</a>
<div>Zaznaczony .</div>
</div>';
} else {
$msgs = '
<div class="alert alert-warning message"><a href="#" class="close" data-dismiss="alert">×</a>
<div>Odznaczony .</div>
</div>';
}