diff --git a/README.md b/README.md index dbe9e3c2..2b06c63d 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ ### Xeorl - The All-In-One, Fully Free to Use Advanced Link Shortener and Management Tool - Powered by [@xodivorce](https://instagram.com/xodivorce) ✨ [![status](https://img.shields.io/badge/status-active-brightgreen.svg?style=flat)](https://github.com/xeorl/xeorl-portfolio/) -[![version](https://img.shields.io/badge/version-v4.2.1-yellow.svg?style=flat)](https://github.com/xeorl/xeorl-portfolio/) +[![version](https://img.shields.io/badge/version-v4.2.2-yellow.svg?style=flat)](https://github.com/xeorl/xeorl-portfolio/) [![PRs](https://img.shields.io/badge/PRs-welcome-blue.svg?style=flat)](https://github.com/xeorl/xeorl-portfolio/)

diff --git a/htdocs/.env.example b/htdocs/.env.example index 2c71e6c6..6dbe5acb 100644 --- a/htdocs/.env.example +++ b/htdocs/.env.example @@ -1,6 +1,6 @@ #This is an example of secret environmental variables #original environmental variable should be created with .env filename -DOMAIN = "Your Domain Name Here" +DOMAIN = "Your Domain Name Here" ### Additionally, you need to set the domain name in the assets/js/home.js file at line 39. DB_HOST = "Your Database Host Name Her" DB_USER = "Your Database Username Here" DB_PASS = "Your Database Password Here" diff --git a/htdocs/assets/js/_home.js b/htdocs/assets/js/_home.js index b67fc7e4..a8e8b6d7 100755 --- a/htdocs/assets/js/_home.js +++ b/htdocs/assets/js/_home.js @@ -36,7 +36,7 @@ shortenBtn.onclick = () => { let data = xhr.response; if (data.length <= 5) { //This is your domain name - const domain = "http://localhost/Php-Projects/xeorl/htdocs/"; + const domain = "xeorl.buzz/"; let shortenURL = domain + data; // Remove the default message if it exists diff --git a/htdocs/core/process.php b/htdocs/core/process.php index ee97d1b9..273cac1b 100644 --- a/htdocs/core/process.php +++ b/htdocs/core/process.php @@ -15,7 +15,6 @@ $dotenv = Dotenv\Dotenv::createImmutable(__DIR__ . '/../'); $dotenv->load(); // Retrieve environment variables -$domain = $_ENV['DOMAIN']; $host = $_ENV['DB_HOST']; $user = $_ENV['DB_USER']; $pass = $_ENV['DB_PASS']; @@ -36,7 +35,7 @@ if (isset($_GET)) { $u = mysqli_real_escape_string($conn, $key); $new_url = str_replace('/', '', $u); } - + // Query the database for the full URL associated with the shortened URL $sql = mysqli_query($conn, "SELECT full_url FROM url WHERE shorten_url = '{$new_url}'"); if (mysqli_num_rows($sql) > 0) { @@ -46,11 +45,13 @@ if (isset($_GET)) { // Fetch the full URL and store it in the session $full_url = mysqli_fetch_assoc($sql); $_SESSION['redirect_url'] = $full_url['full_url']; - - // Redirect to unzipper.php - header("Location: unzipper.php"); - exit(); // Stop further script execution after redirection + + // Instead of header redirect, include the unzipper.php page here + include 'unzipper.php'; // Include the unzipper.php page in this URL + exit(); // Exit to ensure the rest of the script doesn't run } + } else { + } } ?> diff --git a/htdocs/home.php b/htdocs/home.php index d0875e46..19050517 100644 --- a/htdocs/home.php +++ b/htdocs/home.php @@ -91,7 +91,6 @@ ini_set('display_errors', 1); // Include the statistics file - diff --git a/htdocs/unzipper.php b/htdocs/unzipper.php index fbdeb272..3b68cf57 100644 --- a/htdocs/unzipper.php +++ b/htdocs/unzipper.php @@ -1,13 +1,13 @@ @@ -44,12 +44,10 @@ $redirect_url = $_SESSION['redirect_url']; - -