From b6e16acddd8f8f58e2c67bea89f850fb3c36bbc3 Mon Sep 17 00:00:00 2001 From: Aloneinsky Date: Mon, 24 Nov 2025 15:50:40 +0700 Subject: [PATCH] fix some phps --- includes/config.php | 2 +- public/.htaccess | 9 +++------ public/index.php | 2 +- public/logout.php | 2 +- public/signin.php | 6 +++--- public/signup.php | 8 ++++---- 6 files changed, 13 insertions(+), 16 deletions(-) diff --git a/includes/config.php b/includes/config.php index e591f73..94c9f0c 100644 --- a/includes/config.php +++ b/includes/config.php @@ -2,7 +2,7 @@ $host = "localhost"; $user = "root"; $pass = ""; -$db = "mydatabase"; +$db = "hitnrun"; $conn = new mysqli($host, $user, $pass, $db); diff --git a/public/.htaccess b/public/.htaccess index 24ab2d3..f8fbdcd 100644 --- a/public/.htaccess +++ b/public/.htaccess @@ -1,11 +1,8 @@ -# Turn on rewrite engine RewriteEngine On -# If the request is NOT a real file… +# Don't rewrite existing files or directories RewriteCond %{REQUEST_FILENAME} !-f - -# …and NOT a real folder… RewriteCond %{REQUEST_FILENAME} !-d -# Rewrite /something → something.php -RewriteRule ^(.+)$ $1.php [L,QSA] +# Redirect everything else to index.php +RewriteRule ^(.*)$ index.php [L] diff --git a/public/index.php b/public/index.php index 65b4ba6..211c7eb 100644 --- a/public/index.php +++ b/public/index.php @@ -2,7 +2,7 @@ require "../includes/config.php"; if (!isset($_SESSION["uid"])) { - header("Location: login.php"); + header("Location: signin.php"); exit; } ?> diff --git a/public/logout.php b/public/logout.php index 7649023..8ba2a2e 100644 --- a/public/logout.php +++ b/public/logout.php @@ -1,5 +1,5 @@ - + - + -
Belum punya akun? Sign Up!
+
Belum punya akun? Sign Up!
\ No newline at end of file diff --git a/public/signup.php b/public/signup.php index 6cb6559..703e763 100644 --- a/public/signup.php +++ b/public/signup.php @@ -9,7 +9,7 @@ $stmt->bind_param("ss", $username, $password); if ($stmt->execute()) { - echo "Account created! Login here"; + echo "Account created! Login here"; exit; } else { echo "Username already exists."; @@ -34,15 +34,15 @@
- + - +
-
Sudah punya akun? Sign In!
+
Sudah punya akun? Sign In!
\ No newline at end of file