Add modal when i press admin button:
<!DOCTYPE html>
<html>
<head>
<title>Signup Movie G!</title>
</head>
<link rel="stylesheet" href="style.css">
<link rel="icon" type="image" href="src/icon.png">
<body>
<div class="header">Movie G!</div>
<form action="signup.php" method="post">
<div class="container">
<label for=username>Username: <label><input type="text" name="username" required><br>
<label for=email>Email: <label> <input type="email" name="email" required><br>
<label for=password>Password: <label> <input type="password" name="password" required><br>
<input type="submit" name="register" value="Sign Up" class="button"><br><br>
<div class="separator">Already have account ?</div><br>
<a href="login.php" style="background-color: grey;"><input type="button" value="Login" class="button"></a>
<button class="admin" title="This button designed for ADMIN ONLY!" onclick="window.location.href='modal.html';"><span class="adIcon"></span>Admin?</button>
</div>
</form>
<?php
session_start();
require_once "connection.php";
if (isset($_POST["register"])) {
$username = $conn->real_escape_string($_POST["username"]);
$email = $conn->real_escape_string($_POST["email"]);
$password = password_hash($_POST["password"], PASSWORD_DEFAULT);
$sql = "INSERT INTO users (username, email, password) VALUES (?, ?, ?)";
$stmt = $conn->prepare($sql);
$stmt->bind_param("sss", $username, $email, $password);
if ($stmt->execute()) {
echo '<script language="javascript">';
echo 'alert("Registration successful")';
echo '</script>';
} else {
echo "Error: " . $stmt->error;
}
$stmt->close();
$conn->close();
}
?>
</body>
</html>