This commit is contained in:
2025-02-05 04:16:15 +05:30
parent a7b20799ad
commit 7f15dbfc08
6 changed files with 14 additions and 16 deletions

View File

@@ -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) ✨ ### 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/) [![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/) [![PRs](https://img.shields.io/badge/PRs-welcome-blue.svg?style=flat)](https://github.com/xeorl/xeorl-portfolio/)
<br></br> <br></br>

View File

@@ -1,6 +1,6 @@
#This is an example of secret environmental variables #This is an example of secret environmental variables
#original environmental variable should be created with .env filename #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_HOST = "Your Database Host Name Her"
DB_USER = "Your Database Username Here" DB_USER = "Your Database Username Here"
DB_PASS = "Your Database Password Here" DB_PASS = "Your Database Password Here"

View File

@@ -36,7 +36,7 @@ shortenBtn.onclick = () => {
let data = xhr.response; let data = xhr.response;
if (data.length <= 5) { if (data.length <= 5) {
//This is your domain name //This is your domain name
const domain = "http://localhost/Php-Projects/xeorl/htdocs/"; const domain = "xeorl.buzz/";
let shortenURL = domain + data; let shortenURL = domain + data;
// Remove the default message if it exists // Remove the default message if it exists

View File

@@ -15,7 +15,6 @@ $dotenv = Dotenv\Dotenv::createImmutable(__DIR__ . '/../');
$dotenv->load(); $dotenv->load();
// Retrieve environment variables // Retrieve environment variables
$domain = $_ENV['DOMAIN'];
$host = $_ENV['DB_HOST']; $host = $_ENV['DB_HOST'];
$user = $_ENV['DB_USER']; $user = $_ENV['DB_USER'];
$pass = $_ENV['DB_PASS']; $pass = $_ENV['DB_PASS'];
@@ -47,10 +46,12 @@ if (isset($_GET)) {
$full_url = mysqli_fetch_assoc($sql); $full_url = mysqli_fetch_assoc($sql);
$_SESSION['redirect_url'] = $full_url['full_url']; $_SESSION['redirect_url'] = $full_url['full_url'];
// Redirect to unzipper.php // Instead of header redirect, include the unzipper.php page here
header("Location: unzipper.php"); include 'unzipper.php'; // Include the unzipper.php page in this URL
exit(); // Stop further script execution after redirection exit(); // Exit to ensure the rest of the script doesn't run
} }
} else {
} }
} }
?> ?>

View File

@@ -91,7 +91,6 @@ ini_set('display_errors', 1); // Include the statistics file
</div> </div>
</section> </section>
</main> </main>
<?php include 'assets/_cookies.php'; ?>
<?php include 'assets/_footer.php'; ?> <?php include 'assets/_footer.php'; ?>
<script src="assets/js/_home.js"></script> <script src="assets/js/_home.js"></script>
<script src="assets/js/developer_tools.js"></script> <script src="assets/js/developer_tools.js"></script>

View File

@@ -1,13 +1,13 @@
<?php <?php
if (session_status() === PHP_SESSION_NONE) {
session_start(); session_start();
}
// Check if redirect_url is set in session
if (!isset($_SESSION['redirect_url'])) { if (!isset($_SESSION['redirect_url'])) {
http_response_code(400); http_response_code(400);
die("Invalid request! The page you are looking for may have been deleted or removed from our server."); die("Invalid request! The page you are looking for may have been deleted or removed from our server.");
} }
// Retrieve the redirect URL from session
$redirect_url = $_SESSION['redirect_url']; $redirect_url = $_SESSION['redirect_url'];
?> ?>
<!DOCTYPE html> <!DOCTYPE html>
@@ -44,12 +44,10 @@ $redirect_url = $_SESSION['redirect_url'];
<?php include "assets/_footer.php"; ?> <?php include "assets/_footer.php"; ?>
<!-- Inject PHP value into JavaScript -->
<script> <script>
const redirectUrl = "<?php echo $redirect_url; ?>"; // PHP injects the redirect_url const redirectUrl = "<?php echo $redirect_url; ?>";
</script> </script>
<!-- Link to the external JavaScript file -->
<script src="assets/js/_unzipper.js"></script> <script src="assets/js/_unzipper.js"></script>
</body> </body>