When I click the button "baru", it sends me to the page create_pertandingan.php, however, when I click the button "lama", nothing happens. I'm clearing the post array so the user can give another input after reloading.
<?php
session_start();
include("sambungan.php");
if ($_POST) {
if (isset($_POST["baru"])) {
$_POST = array();
header("Location:./create_pertandingan.php");
}
if (isset($POST["lama"])) {
$_POST = array();
header("Location:./main.php");
}
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="https://cdn.jsdelivr.net/npm/
[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
<link href="styles.css" rel="stylesheet">
<title>SPPC</title>
</head>
<body>
<div>
<form action="load_pertandingan.php" method="post">
<p>Load Pertandingan:</p>
<input type="submit" name="baru" value="Baru">
<input type="submit" name="lama" value="Lama">
</form>
</div>
</body>
</html>