fix some phps

This commit is contained in:
Aloneinsky 2025-11-24 15:50:40 +07:00
parent 397b873d2a
commit b6e16acddd
6 changed files with 13 additions and 16 deletions

View File

@ -2,7 +2,7 @@
$host = "localhost"; $host = "localhost";
$user = "root"; $user = "root";
$pass = ""; $pass = "";
$db = "mydatabase"; $db = "hitnrun";
$conn = new mysqli($host, $user, $pass, $db); $conn = new mysqli($host, $user, $pass, $db);

View File

@ -1,11 +1,8 @@
# Turn on rewrite engine
RewriteEngine On RewriteEngine On
# If the request is NOT a real file… # Don't rewrite existing files or directories
RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-f
# …and NOT a real folder…
RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-d
# Rewrite /something → something.php # Redirect everything else to index.php
RewriteRule ^(.+)$ $1.php [L,QSA] RewriteRule ^(.*)$ index.php [L]

View File

@ -2,7 +2,7 @@
require "../includes/config.php"; require "../includes/config.php";
if (!isset($_SESSION["uid"])) { if (!isset($_SESSION["uid"])) {
header("Location: login.php"); header("Location: signin.php");
exit; exit;
} }
?> ?>

View File

@ -1,5 +1,5 @@
<?php <?php
session_start(); session_start();
session_destroy(); session_destroy();
header("Location: login.php"); header("Location: signin.php");
exit; exit;

View File

@ -44,15 +44,15 @@
<form action="" method="post"> <form action="" method="post">
<label>Username</label> <label>Username</label>
<input type="text" id="username" placeholder="Masukkan username" /> <input type="text" id="username" name="username" placeholder="Masukkan username" />
<label>Password</label> <label>Password</label>
<input type="password" id="password" placeholder="Masukkan password" /> <input type="password" id="password" name="password" placeholder="Masukkan password" />
<button type="submit">Sign In</button> <button type="submit">Sign In</button>
</form> </form>
<div class="note">Belum punya akun? <a href="signup.html">Sign Up!</a></div> <div class="note">Belum punya akun? <a href="signup.php">Sign Up!</a></div>
</div> </div>
</body> </body>
</html> </html>

View File

@ -9,7 +9,7 @@
$stmt->bind_param("ss", $username, $password); $stmt->bind_param("ss", $username, $password);
if ($stmt->execute()) { if ($stmt->execute()) {
echo "Account created! <a href='login.php'>Login here</a>"; echo "Account created! <a href='signin.php'>Login here</a>";
exit; exit;
} else { } else {
echo "Username already exists."; echo "Username already exists.";
@ -34,15 +34,15 @@
<form action="" method="post"> <form action="" method="post">
<label>Username</label> <label>Username</label>
<input type="text" placeholder="Masukkan username" /> <input type="text" id="username" name="username" placeholder="Masukkan username" />
<label>Password</label> <label>Password</label>
<input type="password" placeholder="Masukkan password" /> <input type="password" id="password" name="password" placeholder="Masukkan password" />
<button type="submit">Sign Up</button> <button type="submit">Sign Up</button>
</form> </form>
<div class="note">Sudah punya akun? <a href="signin.html">Sign In!</a></div> <div class="note">Sudah punya akun? <a href="signin.php">Sign In!</a></div>
</div> </div>
</body> </body>
</html> </html>