I want that after submitting a message appears and after three seconds refresh to main page. Need some suggestions to Code this.
Here the main Code with no message:
<!DOCTYPE html>
<html>
<meta http-equiv="content-type" content="text/html" />
<meta charset="utf-8" />
<?php
require_once("db.inc.php");
?>
<link rel="stylesheet" type="text/css" href="styles2.css" />
</head>
<body>
<?php
if(isset($_POST['selected_name'])){
$stmt = $mysqli->prepare("DELETE FROM artikel WHERE anr=?");
$stmt->bind_param('i', $_POST['selected_name']);
$stmt->execute();
$stmt->close();
if ()
}
?>
<form action="" method="POST">
<p>Artikel:
<?php
$stmt = $mysqli->prepare("SELECT anr, name FROM artikel");
$stmt->execute();
$stmt->bind_result($anr, $name);
echo "<select name='selected_name'><br />";
while ($stmt->fetch ()) {
echo '<option value='.$anr.'>'.$anr.' | '.$name.'</option>';
}
echo "</select>";
?>
<input type="submit" value="Datensatz löschen" />
</form>
</body>
</html>
For me it's not clear how to Code the if condition in order to let appear the message only after submitting.