From 55448e34c6c6a52a57df56dd411f4037d483396d Mon Sep 17 00:00:00 2001 From: xodivorce Date: Wed, 5 Feb 2025 15:50:04 +0530 Subject: [PATCH] v4.2.3 --- README.md | 2 +- htdocs/account.php | 28 +++--- htdocs/assets/_cookies.php | 41 +------- htdocs/assets/_header.php | 33 +++---- htdocs/assets/css/_cookies.css | 115 +++++++++++++++++------ htdocs/assets/css/_unzipper.css | 12 +-- htdocs/assets/js/_cookies.js | 12 +++ htdocs/assets/js/_developer_tools.js | 23 +++++ htdocs/assets/js/_email.js | 8 +- htdocs/assets/js/_forgot_pass.js | 46 ++------- htdocs/assets/js/_header.js | 8 +- htdocs/assets/js/_home.js | 18 +--- htdocs/assets/js/_login.js | 31 +----- htdocs/assets/js/_register.js | 43 +++------ htdocs/assets/js/_unzipper.js | 27 +++--- htdocs/assets/js/developer_tools.js | 23 ----- htdocs/core/config.php | 9 +- htdocs/core/forgot_pass_action_one.php | 29 ++---- htdocs/core/forgot_pass_action_three.php | 11 +-- htdocs/core/forgot_pass_action_two.php | 24 ++--- htdocs/core/get_session_links.php | 2 - htdocs/core/get_statistics.php | 10 +- htdocs/core/login_action.php | 7 +- htdocs/core/process.php | 19 +--- htdocs/core/redirect_google.php | 14 +-- htdocs/core/register_action.php | 87 ++++++++--------- htdocs/core/resend.php | 47 +++------ htdocs/core/url-controll.php | 17 +++- htdocs/forgot_pass_step_one.php | 18 ++-- htdocs/forgot_pass_step_three.php | 30 +++--- htdocs/forgot_pass_step_two.php | 53 ++++------- htdocs/home.php | 17 ++-- htdocs/login.php | 28 ++---- htdocs/monetization.php | 28 +++--- htdocs/password_reset_success.php | 30 ++---- htdocs/register.php | 58 ++++++------ htdocs/unzipper.php | 46 +++++---- xeorl.sql | 58 +++++------- 38 files changed, 449 insertions(+), 663 deletions(-) create mode 100644 htdocs/assets/js/_cookies.js create mode 100755 htdocs/assets/js/_developer_tools.js delete mode 100755 htdocs/assets/js/developer_tools.js diff --git a/README.md b/README.md index 2b06c63d..41fa8273 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.2-yellow.svg?style=flat)](https://github.com/xeorl/xeorl-portfolio/) +[![version](https://img.shields.io/badge/version-v4.2.3-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/account.php b/htdocs/account.php index cf4d1010..c902122d 100644 --- a/htdocs/account.php +++ b/htdocs/account.php @@ -2,6 +2,7 @@ session_start(); error_reporting(E_ALL); ini_set('display_errors', 1); + if (!isset($_SESSION['user_id'])) { header("Location: login.php"); exit(); @@ -11,29 +12,28 @@ if (!isset($_SESSION['user_id'])) { - - + Account - - - - + + + + - + - -
-

Welcome, !

-

Email:

- Logout -
- + +
+

Welcome, !

+

Email:

+ Logout +
+ diff --git a/htdocs/assets/_cookies.php b/htdocs/assets/_cookies.php index a9991570..400a3a11 100644 --- a/htdocs/assets/_cookies.php +++ b/htdocs/assets/_cookies.php @@ -1,39 +1,6 @@ - - +
-

By clicking "Accept All Cookies", you agree to the storing of cookies on your device to enhance site navigation, analyze site usage, and assist in our marketing efforts.

- - - - × +

This website uses cookies to ensure you get the best experience on our website. Learn more.

+
- - + \ No newline at end of file diff --git a/htdocs/assets/_header.php b/htdocs/assets/_header.php index 39e58053..c8dcfc6b 100755 --- a/htdocs/assets/_header.php +++ b/htdocs/assets/_header.php @@ -10,10 +10,9 @@ if (session_status() === PHP_SESSION_NONE) { - - - - + diff --git a/htdocs/assets/css/_cookies.css b/htdocs/assets/css/_cookies.css index a9f441c1..9317b850 100644 --- a/htdocs/assets/css/_cookies.css +++ b/htdocs/assets/css/_cookies.css @@ -3,45 +3,104 @@ bottom: 0; left: 0; width: 100%; - background: white; + background: #ffffff; box-shadow: 0 -2px 10px rgba(0,0,0,0.1); - padding: 15px; + padding: 10px; display: flex; align-items: center; justify-content: space-between; - font-family: Arial, sans-serif; z-index: 10; + color: #333; + border-top: 1px solid #ddd; + font-size: 14px; + flex-wrap: wrap; } #cookieBanner p { - font-size: 14px; - color: #333; + font-size: 16px; margin: 0; flex: 1; + margin-left: 1.5em; + max-width: 70%; + line-height: 1.5; } -button { - padding: 10px 15px; - border: 1px solid #002147; - cursor: pointer; - font-size: 14px; - border-radius: 4px; - margin: 0 5px; -} - -.cookie-settings { - background: white; - color: #002147; -} - -.reject, .accept { - background: #002147; - color: white; -} - -.close { - font-size: 18px; +#cookieBanner a { + color: #677583; font-weight: bold; - cursor: pointer; - margin-left: 10px; + text-decoration: none; } + +.accept { + font-family: "Montserrat", sans-serif; + padding: 10px 20px; + background-color: #4d555cec; + margin-right: 3em; + color: #ffffff; + border: none; + border-radius: 20px; + cursor: pointer; + font-weight: 600; + font-size: 14px; + box-shadow: 0 4px 8px rgba(0, 0, 0, 0.082); + outline: none; + box-sizing: border-box; + transition: box-shadow 0.3s ease, background-color 0.3s ease; +} + +.accept:hover { + background-color: #171C24; + box-shadow: 0 4px 10px rgba(0, 0, 0, 0.250); +} + +/* Mobile and Tablet Responsive Styles */ +@media (max-width: 720px) { + #cookieBanner p { + font-size: 16px; + margin: 0; + flex: 1; + margin-left: 1.5em; + max-width: 70%; + line-height: 1.5; + } + + #cookieBanner a { + color: #677583; + font-weight: bold; + text-decoration: none; + } + .accept { + background-color:#171C24 ; + + } + +} + +@media (max-width: 509px) { + #cookieBanner p { + font-size: 14px; + margin: 0; + flex: 1; + margin-left: 1.5em; + max-width: 70%; + line-height: 1.5; + } + + #cookieBanner a { + text-decoration: none; + } + .accept { + font-size: 12px; + background-color:#171C24 ; + padding: 9px 18px; + } +} + +@media (max-width: 409px){ + + .accept { + font-size: 12px; + background-color:#171C24 ; + padding: 8px 16px; + } +} \ No newline at end of file diff --git a/htdocs/assets/css/_unzipper.css b/htdocs/assets/css/_unzipper.css index 0c5ce844..3e0defb4 100644 --- a/htdocs/assets/css/_unzipper.css +++ b/htdocs/assets/css/_unzipper.css @@ -52,7 +52,6 @@ h2 { .countdown { font-size: 16px; font-weight: 400; - margin-top: -px; color: rgb(70, 41, 204); text-align: center; } @@ -83,17 +82,19 @@ button:active { box-shadow: rgba(68, 68, 68, 0.572) 3px 2px 10px 0px; cursor: pointer; } -@media (max-width: 1170px){ - .container{ +@media (max-width: 1170px) { + .container { width: 650px; } } -@media (max-width: 1024px){ - .container{ + +@media (max-width: 1024px) { + .container { width: 500px; } } + @media (max-width: 768px) { .container { padding: 40px 20px; @@ -129,7 +130,6 @@ button:active { font-size: 22px; } - .countdown span { font-size: 18px; } diff --git a/htdocs/assets/js/_cookies.js b/htdocs/assets/js/_cookies.js new file mode 100644 index 00000000..b01afb26 --- /dev/null +++ b/htdocs/assets/js/_cookies.js @@ -0,0 +1,12 @@ +function acceptCookies() { + document.cookie = "user_cookies=accepted; path=/; max-age=" + 60*60*24*30; + document.getElementById("cookieBanner").style.display = "none"; +} + +window.onload = function() { + if (document.cookie.indexOf("user_cookies") === -1) { + document.getElementById("cookieBanner").style.display = "flex"; + } else { + document.getElementById("cookieBanner").style.display = "none"; + } +}; diff --git a/htdocs/assets/js/_developer_tools.js b/htdocs/assets/js/_developer_tools.js new file mode 100755 index 00000000..d5150047 --- /dev/null +++ b/htdocs/assets/js/_developer_tools.js @@ -0,0 +1,23 @@ +(function() { + function checkDevTools() { + console.clear(); + console.log('%cSTOP!', 'color: red; font-size: 50px; font-weight: bold;'); + console.log('%cThis is a browser feature intended for developers.', 'color: white; background: red; font-size: 16px; padding: 5px;'); + console.log('%cIf someone told you to copy-paste something here to enable a premium feature or "hack" someone\'s account, it is a scam and will give them access to your Xeorl account.', 'color: white; background: black; font-size: 14px; padding: 5px;'); + } + + function detectDevTools() { + const threshold = 160; + const widthThreshold = 400; + + if ( + window.outerHeight - window.innerHeight > threshold || + window.outerWidth - window.innerWidth > widthThreshold + ) { + checkDevTools(); + } + } + + window.addEventListener('resize', detectDevTools); + setInterval(detectDevTools, 1000); +})(); diff --git a/htdocs/assets/js/_email.js b/htdocs/assets/js/_email.js index 66529b05..477b7517 100644 --- a/htdocs/assets/js/_email.js +++ b/htdocs/assets/js/_email.js @@ -1,13 +1,7 @@ function storeEmailAndContinue() { - // Get the email entered by the user var email = document.getElementById('email').value; - - // Store the email in sessionStorage sessionStorage.setItem('userEmail', email); - - // Redirect to the next step location.href = 'forgot_pass_step_two.php'; } - // Retrieve the email from sessionStorage and display it - document.getElementById('userEmail').textContent = sessionStorage.getItem('userEmail') || 'hygeonhealth@example.com'; +document.getElementById('userEmail').textContent = sessionStorage.getItem('userEmail') || 'supportxeorl@example.com'; diff --git a/htdocs/assets/js/_forgot_pass.js b/htdocs/assets/js/_forgot_pass.js index ee53ca16..eea2e0a4 100644 --- a/htdocs/assets/js/_forgot_pass.js +++ b/htdocs/assets/js/_forgot_pass.js @@ -1,66 +1,33 @@ -// // Array of background image sources -// const images = ['assets/images/dna.jpg', 'assets/images/dna2.jpg', 'assets/images/dna3.jpg', 'assets/images/dna4.jpg']; -// let currentIndex = 0; - -// function changeBackgroundImage() { -// const imgElement = document.getElementById('background-image'); -// // Fade out -// imgElement.style.opacity = 0; - -// setTimeout(() => { -// // Change image source -// currentIndex = (currentIndex + 1) % images.length; -// imgElement.src = images[currentIndex]; - -// // Fade in -// imgElement.style.opacity = 1; -// }, 800); // Match this timeout with the CSS transition duration -// } - -// // Change image every 5 seconds -// setInterval(changeBackgroundImage, 5000); - - -// Password visibility toggle logic const passwordField = document.getElementById('password-field'); const togglePassword = document.getElementById('toggle-password'); togglePassword.addEventListener('click', function () { - // Toggle between 'password' and 'text' const type = passwordField.getAttribute('type') === 'password' ? 'text' : 'password'; passwordField.setAttribute('type', type); - - // Optionally toggle the eye icon image (if different images are needed) this.src = type === 'password' ? 'assets/images/eye.svg' : 'assets/images/eye-off.svg'; }); -// Password Reset Function function togglePasswordVisibility() { const confirmPasswordInput = document.getElementById('confirmPassword'); - if (confirmPasswordInput.type === 'password') { - confirmPasswordInput.type = 'text'; // Show password - } else { - confirmPasswordInput.type = 'password'; // Hide password - } + confirmPasswordInput.type = confirmPasswordInput.type === 'password' ? 'text' : 'password'; } -// Conform Password Seen Function + function resetPassword() { const newPassword = document.getElementById('newPassword').value; const confirmPassword = document.getElementById('confirmPassword').value; const validationMessage = document.getElementById('validation-message'); if (newPassword.length < 8) { - showMessage('Password must be at least 8 characters long.', '#FF0000'); // Red color for error + showMessage('Password must be at least 8 characters long.', '#FF0000'); return; } if (newPassword !== confirmPassword) { - showMessage('Passwords do not match. Please try again.', '#FF0000'); // Red color for error + showMessage('Passwords do not match. Please try again.', '#FF0000'); return; } - // Redirect or submit form after validation - location.href = 'password_reset_success.php'; // Change this to your success page + location.href = 'password_reset_success.php'; } function showMessage(message, color) { @@ -69,8 +36,7 @@ function showMessage(message, color) { validationMessage.style.color = color; validationMessage.style.display = 'block'; - // Hide the message after 5 seconds (5000ms) setTimeout(function() { validationMessage.style.display = 'none'; }, 5000); -} \ No newline at end of file +} diff --git a/htdocs/assets/js/_header.js b/htdocs/assets/js/_header.js index 5f2fecb6..09686cd3 100644 --- a/htdocs/assets/js/_header.js +++ b/htdocs/assets/js/_header.js @@ -2,7 +2,6 @@ document.addEventListener("DOMContentLoaded", function () { const burgerToggle = document.getElementById("burger-toggle"); const sidebar = document.querySelector(".sidebar"); - // Ensure sidebar is hidden initially sidebar.style.display = "none"; burgerToggle.addEventListener("click", function () { @@ -17,12 +16,11 @@ document.addEventListener("DOMContentLoaded", function () { }); window.addEventListener('scroll', function () { - const header = document.querySelector('.header'); // Get the header element + const header = document.querySelector('.header'); - // Check if the page has been scrolled if (window.scrollY > 0) { - header.classList.add('scrolled'); // Add the "scrolled" class + header.classList.add('scrolled'); } else { - header.classList.remove('scrolled'); // Remove the "scrolled" class + header.classList.remove('scrolled'); } }); diff --git a/htdocs/assets/js/_home.js b/htdocs/assets/js/_home.js index a8e8b6d7..c2ebb62d 100755 --- a/htdocs/assets/js/_home.js +++ b/htdocs/assets/js/_home.js @@ -3,7 +3,6 @@ const form = document.querySelector(".shorten-form"), shortenBtn = document.querySelector("#shorten-btn"), linksList = document.querySelector("#links-list"); -// Clear the list and show the "You don't have any shortened links" message function resetLinksList() { linksList.innerHTML = `
  • @@ -18,7 +17,6 @@ function resetLinksList() { `; } -// Check session storage for existing links on page load document.addEventListener("DOMContentLoaded", () => { const savedLinks = sessionStorage.getItem("shortenedLinks"); if (savedLinks) { @@ -35,17 +33,15 @@ shortenBtn.onclick = () => { if (xhr.readyState == 4 && xhr.status == 200) { let data = xhr.response; if (data.length <= 5) { - //This is your domain name - const domain = "xeorl.buzz/"; + // This is your shoeten domain name + const domain = "http://localhost/Php-Projects/xeorl/htdocs//"; let shortenURL = domain + data; - // Remove the default message if it exists const defaultMessage = document.getElementById("default-message"); if (defaultMessage) { defaultMessage.remove(); } - // Add the new link to the list let newRow = `
  • @@ -58,12 +54,9 @@ shortenBtn.onclick = () => {
  • `; - // Append the new link to the list and update session storage linksList.insertAdjacentHTML('afterbegin', newRow); sessionStorage.setItem("shortenedLinks", linksList.innerHTML); - - // Clear the input field - urlInput.value = ""; + urlInput.value = ""; } else { alert(data); } @@ -74,7 +67,6 @@ shortenBtn.onclick = () => { xhr.send(formData); }; -// Handle copy button clicks document.addEventListener('click', function(e) { if (e.target.closest('.copy-btn')) { const linkInfo = e.target.closest('li').querySelector('.short-link').textContent; @@ -84,13 +76,13 @@ document.addEventListener('click', function(e) { } }); -// Handle members only delete button clicks!! document.addEventListener('click', function(e) { if (e.target.closest('.delete-btn')) { alert("This feature is available for members only."); } }); + // Handle delete button clicks /* document.addEventListener('click', function(e) { @@ -118,5 +110,3 @@ document.addEventListener('click', function(e) { } });*/ - - diff --git a/htdocs/assets/js/_login.js b/htdocs/assets/js/_login.js index 6213243a..b2d623ae 100644 --- a/htdocs/assets/js/_login.js +++ b/htdocs/assets/js/_login.js @@ -1,6 +1,3 @@ -// script.js - -// Add any form validation or interactivity here, like checking if the fields are filled document.querySelector("form").addEventListener("submit", function(event) { const inputs = document.querySelectorAll(".input-field"); let valid = true; @@ -15,40 +12,14 @@ document.querySelector("form").addEventListener("submit", function(event) { }); if (!valid) { - event.preventDefault(); // Prevent form submission if validation fails + event.preventDefault(); alert("Please fill all the fields."); } }); - document.getElementById('toggle-password').addEventListener('click', function () { const passwordField = document.getElementById('password-field'); const passwordType = passwordField.getAttribute('type') === 'password' ? 'text' : 'password'; passwordField.setAttribute('type', passwordType); - - // Optionally, you can change the eye icon to an "eye-off" icon when the password is visible this.src = passwordType === 'password' ? 'assets/images/eye.svg' : 'assets/images/eye-off.svg'; }); - - // // Array of background image sources - // const images = ['assets/images/wire.jpg', 'assets/images/internet.jpg','assets/images/redworld.jpg','assets/images/travel.jpg']; - // let currentIndex = 0; - - // function changeBackgroundImage() { - // const imgElement = document.getElementById('background-image'); - // // Fade out - // imgElement.style.opacity = 0; - - // setTimeout(() => { - // // Change image source - // currentIndex = (currentIndex + 1) % images.length; - // imgElement.src = images[currentIndex]; - - // // Fade in - // imgElement.style.opacity = 1; - // }, 800); // Match this timeout with the CSS transition duration - // } - - // // Change image every 5 seconds - // setInterval(changeBackgroundImage, 5000); - \ No newline at end of file diff --git a/htdocs/assets/js/_register.js b/htdocs/assets/js/_register.js index ccb44675..b19459e5 100644 --- a/htdocs/assets/js/_register.js +++ b/htdocs/assets/js/_register.js @@ -1,10 +1,7 @@ -// script.js - -// Add any form validation or interactivity here, like checking if the fields are filled document.querySelector("form").addEventListener("submit", function(event) { const inputs = document.querySelectorAll(".input-field"); let valid = true; - + inputs.forEach(input => { if (input.value === "") { valid = false; @@ -15,39 +12,29 @@ document.querySelector("form").addEventListener("submit", function(event) { }); if (!valid) { - event.preventDefault(); // Prevent form submission if validation fails + event.preventDefault(); alert("Please fill all the fields."); } }); - -document.getElementById('toggle-password').addEventListener('click', function () { +document.getElementById('toggle-password').addEventListener('click', function() { const passwordField = document.getElementById('password-field'); const passwordType = passwordField.getAttribute('type') === 'password' ? 'text' : 'password'; passwordField.setAttribute('type', passwordType); - - // Optionally, you can change the eye icon to an "eye-off" icon when the password is visible this.src = passwordType === 'password' ? 'assets/images/eye.svg' : 'assets/images/eye-off.svg'; }); - // // Array of background image sources - // const images = ['assets/images/dna.jpg', 'assets/images/dna2.jpg','assets/images/dna3.jpg','assets/images/dna4.jpg']; - // let currentIndex = 0; +function toggleSubmitButton() { + const checkbox = document.getElementById("agree"); + const submitBtn = document.getElementById("submit-btn"); + const errorMessage = document.getElementById("error-message"); - // function changeBackgroundImage() { - // const imgElement = document.getElementById('background-image'); - // // Fade out - // imgElement.style.opacity = 0; + if (checkbox.checked) { + submitBtn.disabled = false; + errorMessage.style.display = "none"; + } else { + submitBtn.disabled = true; + } +} - // setTimeout(() => { - // // Change image source - // currentIndex = (currentIndex + 1) % images.length; - // imgElement.src = images[currentIndex]; - - // // Fade in - // imgElement.style.opacity = 1; - // }, 800); // Match this timeout with the CSS transition duration - // } - - // // Change image every 5 seconds - // setInterval(changeBackgroundImage, 5000); \ No newline at end of file +document.addEventListener("DOMContentLoaded", toggleSubmitButton); diff --git a/htdocs/assets/js/_unzipper.js b/htdocs/assets/js/_unzipper.js index cde65ce2..a8c88bf1 100644 --- a/htdocs/assets/js/_unzipper.js +++ b/htdocs/assets/js/_unzipper.js @@ -1,4 +1,3 @@ -// Countdown logic let countdown = 10; let countdownInterval; const timerElement = document.getElementById("timer"); @@ -10,15 +9,15 @@ function updateCountdown() { timerElement.textContent = countdown; } if (countdown <= 0) { - button.disabled = false; // Enable the button when countdown ends - button.classList.add("active"); // Optional, if you use active class for style - button.style.cursor = "pointer"; // Enable cursor - setTimeout(function () { - button.textContent = "Getting links..."; // Change text before enabling - }, 300); // 0.3 seconds delay - setTimeout(function () { - button.textContent = "Get link"; // Final button text - }, 600); // After another 0.3 seconds + button.disabled = false; + button.classList.add("active"); + button.style.cursor = "pointer"; + setTimeout(() => { + button.textContent = "Getting links..."; + }, 300); + setTimeout(() => { + button.textContent = "Get link"; + }, 600); clearInterval(countdownInterval); } } @@ -32,14 +31,12 @@ function stopCountdown() { } function init() { - // Initialize countdown value and button state countdown = 10; timerElement.textContent = countdown; button.disabled = true; button.classList.remove("active"); button.style.cursor = "not-allowed"; button.textContent = "PLEASE WAIT..."; - startCountdown(); } @@ -52,11 +49,11 @@ document.addEventListener("visibilitychange", () => { }); window.addEventListener("beforeunload", () => { - init(); // Reset state when the page is about to be unloaded + init(); }); -init(); // Call init to initialize the countdown when the page loads +init(); function redirect() { - window.location.href = redirectUrl; // Redirect to the full URL + window.location.href = redirectUrl; } diff --git a/htdocs/assets/js/developer_tools.js b/htdocs/assets/js/developer_tools.js deleted file mode 100755 index 7459ca03..00000000 --- a/htdocs/assets/js/developer_tools.js +++ /dev/null @@ -1,23 +0,0 @@ -//Right-click disable -document.addEventListener('contextmenu', event => event.preventDefault()); - -// Disable common keyboard shortcuts for developer tools - document.addEventListener('keydown', function(event) { - if (event.ctrlKey && (event.key === 'I' || event.key === 'i' || event.key === 'J' || event.key === 'j' || event.key === 'U' || event.key === 'u')) { - event.preventDefault(); - } - if (event.key === 'F12') { - event.preventDefault(); - } - }); - - // Detect developer tools opening - (function() { - const element = new Image(); - Object.defineProperty(element, 'id', { - get: function() { - alert('Developer tools opened!'); - } - }); - console.log(element); - })(); \ No newline at end of file diff --git a/htdocs/core/config.php b/htdocs/core/config.php index 7236c456..5afc8008 100755 --- a/htdocs/core/config.php +++ b/htdocs/core/config.php @@ -1,18 +1,15 @@ load(); -// Database configuration $host = $_ENV['DB_HOST']; $user = $_ENV['DB_USER']; $pass = $_ENV['DB_PASS']; $db = $_ENV['DB_NAME']; -// Establish database connection $conn = mysqli_connect($host, $user, $pass, $db); if (!$conn) { die("Database connection error: " . mysqli_connect_error()); diff --git a/htdocs/core/forgot_pass_action_one.php b/htdocs/core/forgot_pass_action_one.php index c83a6141..87885a5f 100644 --- a/htdocs/core/forgot_pass_action_one.php +++ b/htdocs/core/forgot_pass_action_one.php @@ -1,10 +1,8 @@ load(); -// Database connection require_once 'config.php'; $email = $_POST['email']; if (filter_var($email, FILTER_VALIDATE_EMAIL)) { - // Generate a 6-digit OTP - $otp = rand(100000, 999999); // 6-digit OTP + $otp = rand(100000, 999999); - // Update the OTP in the database using mysqli $sql = "UPDATE user SET user_otp = '$otp' WHERE user_email = '$email'"; if ($conn->query($sql) === TRUE) { - // Send OTP email $mail = new PHPMailer(true); try { - // Server settings $mail->isSMTP(); - $mail->Host = $_ENV['SMTP_HOST']; // Set the SMTP server to send through + $mail->Host = $_ENV['SMTP_HOST']; $mail->SMTPAuth = true; - $mail->Username = $_ENV['SMTP_USER']; // SMTP username - $mail->Password = $_ENV['SMTP_PASS']; // SMTP password + $mail->Username = $_ENV['SMTP_USER']; + $mail->Password = $_ENV['SMTP_PASS']; $mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS; $mail->Port = $_ENV['SMTP_PORT']; - // Recipients $mail->setFrom($_ENV['SMTP_USER'], 'Xeorl Support'); - $mail->addAddress($email); // Add a recipient + $mail->addAddress($email); - // Content $mail->isHTML(true); $mail->Subject = 'Password Reset - Xeorl'; $mail->Body = @@ -62,11 +53,11 @@ if (filter_var($email, FILTER_VALIDATE_EMAIL)) { $mail->AltBody = 'Your OTP code is ' . $otp; $mail->send(); - // Redirect to ../forgot_pass_step_two.php - session_start(); // Start the session - $_SESSION['email'] = $email; // Store the email in the session - header('Location: ../forgot_pass_step_two.php'); // Redirect to the next page - exit; // Ensure no further script execution after redirection + + session_start(); + $_SESSION['email'] = $email; + header('Location: ../forgot_pass_step_two.php'); + exit; } catch (Exception $e) { echo "Message could not be sent. Mailer Error: {$mail->ErrorInfo}"; } diff --git a/htdocs/core/forgot_pass_action_three.php b/htdocs/core/forgot_pass_action_three.php index 4613ce28..3e86dd4e 100644 --- a/htdocs/core/forgot_pass_action_three.php +++ b/htdocs/core/forgot_pass_action_three.php @@ -1,10 +1,9 @@ query($sql); // Execute the query + $sql = "SELECT user_otp FROM user WHERE user_email = ?"; + $stmt = $conn->prepare($sql); + $stmt->bind_param('s', $email); + $stmt->execute(); + $result = $stmt->get_result(); if ($result && $result->num_rows > 0) { $row = $result->fetch_assoc(); - $dbOtp = $row['user_otp']; // Fetch the OTP from the result set + $dbOtp = $row['user_otp']; - // Check if the OTP entered by the user matches the one in the database if ($userOtp == $dbOtp) { - // OTP is correct, redirect to the next step header('Location: ../forgot_pass_step_three.php'); exit; } else { - // OTP is incorrect, set error message $_SESSION['error_message'] = "Invalid OTP. Please double-check the OTP."; header('Location: ../forgot_pass_step_two.php'); exit; } } else { - // Query failed or no result, set error message $_SESSION['error_message'] = "Failed to retrieve OTP from the database."; header('Location: ../forgot_pass_step_two.php'); exit; } } else { - // If email or OTP is empty, set error message $_SESSION['error_message'] = "Please fill out the OTP."; header('Location: ../forgot_pass_step_two.php'); exit; diff --git a/htdocs/core/get_session_links.php b/htdocs/core/get_session_links.php index 73d00474..c731d986 100644 --- a/htdocs/core/get_session_links.php +++ b/htdocs/core/get_session_links.php @@ -4,12 +4,10 @@ include "config.php"; error_reporting(E_ALL); ini_set('display_errors', 1); -// Check if the session variable for storing shortened links exists if (!isset($_SESSION['shortened_links'])) { $_SESSION['shortened_links'] = array(); } -// Retrieve and return the list of shortened links for the current session $links = array(); foreach ($_SESSION['shortened_links'] as $link_id) { $sql = mysqli_query($conn, "SELECT * FROM url WHERE id = '{$link_id}'"); diff --git a/htdocs/core/get_statistics.php b/htdocs/core/get_statistics.php index 8f277ce2..bde87281 100644 --- a/htdocs/core/get_statistics.php +++ b/htdocs/core/get_statistics.php @@ -1,16 +1,12 @@ diff --git a/htdocs/core/login_action.php b/htdocs/core/login_action.php index 667dc418..a4ce3eff 100644 --- a/htdocs/core/login_action.php +++ b/htdocs/core/login_action.php @@ -8,7 +8,6 @@ if (isset($_POST['login_btn'])) { $email = mysqli_real_escape_string($conn, $_POST['user_email']); $password = $_POST['user_pass']; - // Check if the email exists $stmt = mysqli_prepare($conn, "SELECT * FROM user WHERE user_email = ?"); mysqli_stmt_bind_param($stmt, "s", $email); mysqli_stmt_execute($stmt); @@ -17,22 +16,18 @@ if (isset($_POST['login_btn'])) { if (mysqli_num_rows($result) > 0) { $row = mysqli_fetch_assoc($result); - // Check if the user is banned if ($row['user_type'] == 4) { $_SESSION['error'] = "Your account is banned. Please contact support."; header('Location: ../login.php'); exit(); } - // Verify the password if (password_verify($password, $row['user_pass'])) { - // Set session variables $_SESSION['user_id'] = $row['id']; $_SESSION['user_name'] = $row['user_name']; $_SESSION['user_email'] = $row['user_email']; $_SESSION['user_type'] = $row['user_type']; - // Redirect to monetization after successful login header('Location: ../monetization.php'); exit(); } else { @@ -46,4 +41,4 @@ if (isset($_POST['login_btn'])) { exit(); } } -?> \ No newline at end of file +?> diff --git a/htdocs/core/process.php b/htdocs/core/process.php index 273cac1b..b3505891 100644 --- a/htdocs/core/process.php +++ b/htdocs/core/process.php @@ -1,57 +1,42 @@ load(); -// Retrieve environment variables $host = $_ENV['DB_HOST']; $user = $_ENV['DB_USER']; $pass = $_ENV['DB_PASS']; $db = $_ENV['DB_NAME']; -// Establish database connection $conn = mysqli_connect($host, $user, $pass, $db); if (!$conn) { die("Database connection error: " . mysqli_connect_error()); } -// Initialize the shortened URL variable $new_url = ""; -// Check if there's a GET request and process the shortened URL if (isset($_GET)) { foreach ($_GET as $key => $val) { $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) { - // Increment the click count for the shortened URL $sql2 = mysqli_query($conn, "UPDATE url SET clicks = clicks + 1 WHERE shorten_url = '{$new_url}'"); if ($sql2) { - // Fetch the full URL and store it in the session $full_url = mysqli_fetch_assoc($sql); $_SESSION['redirect_url'] = $full_url['full_url']; - - // 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 + include 'unzipper.php'; + exit(); } - } else { - } } ?> diff --git a/htdocs/core/redirect_google.php b/htdocs/core/redirect_google.php index 6ad4c156..3e61579f 100644 --- a/htdocs/core/redirect_google.php +++ b/htdocs/core/redirect_google.php @@ -1,17 +1,14 @@ load(); error_reporting(E_ALL); ini_set('display_errors', 1); -// Database configuration $clientID = $_ENV['CLIENT_ID']; $clientSecret = $_ENV['CLIENT_SECRET']; $redirectUri = $_ENV['REDIRECT_URI']; @@ -34,33 +31,28 @@ if (isset($_GET['code'])) { $name = $google_account_info->name; $email = $google_account_info->email; - // Check if user exists in database $stmt = $conn->prepare("SELECT id, user_name, user_email, user_type FROM user WHERE google_id = ? OR user_email = ?"); $stmt->bind_param("ss", $google_id, $email); $stmt->execute(); $result = $stmt->get_result(); if ($result->num_rows == 0) { - // Insert new user - $default_user_type = 3; // Default user type + $default_user_type = 3; $stmt = $conn->prepare("INSERT INTO user (google_id, user_email, user_name, user_type) VALUES (?, ?, ?, ?)"); $stmt->bind_param("sssi", $google_id, $email, $name, $default_user_type); $stmt->execute(); $user_id = $stmt->insert_id; } else { - // User exists, fetch user ID $row = $result->fetch_assoc(); $user_id = $row['id']; $name = $row['user_name']; $email = $row['user_email']; } - // Store user session $_SESSION['user_id'] = $user_id; $_SESSION['user_name'] = $name; $_SESSION['user_email'] = $email; - // Redirect to monetization header("Location: ../monetization.php"); exit(); } else { diff --git a/htdocs/core/register_action.php b/htdocs/core/register_action.php index 1a618778..7b744ab7 100644 --- a/htdocs/core/register_action.php +++ b/htdocs/core/register_action.php @@ -1,57 +1,52 @@ query($checkEmail); + if (isset($_POST['submit_btn'])) { + $fName = mysqli_real_escape_string($conn, $_POST['f_name']); + $lName = mysqli_real_escape_string($conn, $_POST['l_name']); + $email = mysqli_real_escape_string($conn, $_POST['user_email']); + $password = mysqli_real_escape_string($conn, $_POST['user_pass']); + $uName = $fName . " " . $lName; + $uType = 3; - if ($result->num_rows > 0) { - // Store the error message in the session - $_SESSION['error'] = "Email already exists. Please use a different email."; - header('Location: ../register.php'); // Redirect to the register page - exit(); - } else { - // Hash the password before storing it - $hashedPassword = password_hash($password, PASSWORD_BCRYPT); - - // Insert the user data with hashed password - $sql = "INSERT INTO user (`user_name`, `user_email`, `user_pass`, `user_type`, `user_otp`) - VALUES ('$uName', '$email', '$hashedPassword', '$uType', NULL)"; - - if ($conn->query($sql) === TRUE) { - // Get the user ID of the newly registered user - $userId = $conn->insert_id; - - // Optionally, send an email or OTP for verification here - - // Redirect to login page after successful registration - header('Location: ../login.php'); - exit(); - } else { - $_SESSION['error'] = "Error: " . $sql . "
    " . $conn->error; + if (strlen($password) < 8) { + $_SESSION['error'] = "Password must be at least 8 characters long."; header('Location: ../register.php'); exit(); } - } -} -$conn->close(); + $checkEmail = "SELECT * FROM user WHERE user_email = '$email'"; + $result = $conn->query($checkEmail); + + if ($result->num_rows > 0) { + $_SESSION['error'] = "Email already exists. Please use a different email."; + header('Location: ../register.php'); + exit(); + } else { + $hashedPassword = password_hash($password, PASSWORD_BCRYPT); + $sql = "INSERT INTO user (`user_name`, `user_email`, `user_pass`, `user_type`, `user_otp`) + VALUES ('$uName', '$email', '$hashedPassword', '$uType', NULL)"; + + if ($conn->query($sql) === TRUE) { + $userId = $conn->insert_id; + header('Location: ../login.php'); + exit(); + } else { + $_SESSION['error'] = "Error: " . $sql . "
    " . $conn->error; + header('Location: ../register.php'); + exit(); + } + } + } + + $conn->close(); +} ?> diff --git a/htdocs/core/resend.php b/htdocs/core/resend.php index cef22d0f..6be517be 100644 --- a/htdocs/core/resend.php +++ b/htdocs/core/resend.php @@ -1,70 +1,46 @@ load(); -// Check if the email is stored in the session if (isset($_SESSION['email'])) { $email = $_SESSION['email']; + $otp = rand(100000, 999999); - // Generate a new 6-digit OTP - $otp = rand(100000, 999999); // Change this to generate a 6-digit OTP - - // Update the OTP in the database for the user using mysqli $sql = "UPDATE user SET user_otp = '$otp' WHERE user_email = '$email'"; if (mysqli_query($conn, $sql)) { - // Send the OTP to the user's email $mail = new PHPMailer(true); try { - // Server settings $mail->isSMTP(); - $mail->Host = $_ENV['SMTP_HOST']; // SMTP server - $mail->SMTPAuth = true; - $mail->Username = $_ENV['SMTP_USER']; // SMTP username - $mail->Password = $_ENV['SMTP_PASS']; // SMTP password + $mail->Host = $_ENV['SMTP_HOST']; + $mail->SMTPAuth = true; + $mail->Username = $_ENV['SMTP_USER']; + $mail->Password = $_ENV['SMTP_PASS']; $mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS; - $mail->Port = $_ENV['SMTP_PORT']; + $mail->Port = $_ENV['SMTP_PORT']; - // Recipients $mail->setFrom($_ENV['SMTP_USER'], 'Xeorl Support'); - $mail->addAddress($email); // Add a recipient + $mail->addAddress($email); - // Content $mail->isHTML(true); $mail->Subject = 'Password Reset - Xeorl'; - $mail->Body = - 'Hello User,

    - Your one time password: ' . $otp . '.

    - - Your one-time password (OTP) is valid for a single session. If you refresh the page or exit the Next Step portal, you will need to regenerate a new OTP.

    - - If you did not request this OTP, please contact us immediately at www.xeorl.buzz

    - - Regards,
    - Xeorl
    - ' . date("Y") . ' © All rights reserved'; - + $mail->Body = 'Hello User,

    Your one time password: ' . $otp . '.

    Your one-time password (OTP) is valid for a single session. If you refresh the page or exit the Next Step portal, you will need to regenerate a new OTP.

    If you did not request this OTP, please contact us immediately at www.xeorl.buzz

    Regards,
    Xeorl
    ' . date("Y") . ' © All rights reserved'; $mail->AltBody = 'Your OTP code is ' . $otp; - // Send the email $mail->send(); $_SESSION['success_message'] = 'A new OTP has been sent to your email address.'; - header('Location: ../forgot_pass_step_two.php'); // Redirect back to the confirmation page + header('Location: ../forgot_pass_step_two.php'); exit; - } catch (Exception $e) { echo "Message could not be sent. Mailer Error: {$mail->ErrorInfo}"; } @@ -72,7 +48,6 @@ if (isset($_SESSION['email'])) { echo "Failed to update OTP in the database: " . mysqli_error($conn); } - // Close the MySQLi statement mysqli_close($conn); } else { echo "No email found in session."; diff --git a/htdocs/core/url-controll.php b/htdocs/core/url-controll.php index 25f3faff..22720f74 100755 --- a/htdocs/core/url-controll.php +++ b/htdocs/core/url-controll.php @@ -3,6 +3,7 @@ session_start(); include "config.php"; error_reporting(E_ALL); ini_set('display_errors', 1); + $full_url = mysqli_real_escape_string($conn, $_POST['full_url']); if (!empty($full_url) && filter_var($full_url, FILTER_VALIDATE_URL)) { @@ -12,14 +13,22 @@ if (!empty($full_url) && filter_var($full_url, FILTER_VALIDATE_URL)) { if (mysqli_num_rows($sql) > 0) { echo "Something went wrong. Please generate again!"; } else { - $sql2 = mysqli_query($conn, "INSERT INTO url (full_url, shorten_url, clicks) - VALUES ('{$full_url}', '{$ran_url}', '0')"); + $user_email = isset($_SESSION['user_email']) ? $_SESSION['user_email'] : NULL; + + if ($user_email !== NULL) { + $sql2 = mysqli_query($conn, "INSERT INTO url (full_url, shorten_url, clicks, user_email) + VALUES ('{$full_url}', '{$ran_url}', '0', '{$user_email}')"); + } else { + $sql2 = mysqli_query($conn, "INSERT INTO url (full_url, shorten_url, clicks) + VALUES ('{$full_url}', '{$ran_url}', '0')"); + } + if ($sql2) { - $link_id = mysqli_insert_id($conn); // Get the ID of the newly inserted row + $link_id = mysqli_insert_id($conn); if (!isset($_SESSION['shortened_links'])) { $_SESSION['shortened_links'] = array(); } - $_SESSION['shortened_links'][] = $link_id; // Store the link ID in session + $_SESSION['shortened_links'][] = $link_id; $shorten_url = $ran_url; echo $shorten_url; diff --git a/htdocs/forgot_pass_step_one.php b/htdocs/forgot_pass_step_one.php index 6d6ac367..750414ab 100644 --- a/htdocs/forgot_pass_step_one.php +++ b/htdocs/forgot_pass_step_one.php @@ -3,12 +3,12 @@ - - - - + + + + - + @@ -17,19 +17,16 @@
    -
    -

    Xeorl

    +

    Xeorl

    Background Image -

    Unimited Shortens but,
    One Link at a Time

    +

    Unlimited Shortens but,
    One Link at a Time

    - -

    Reset your password

    @@ -41,7 +38,6 @@
    - diff --git a/htdocs/forgot_pass_step_three.php b/htdocs/forgot_pass_step_three.php index fd3d49ab..7408455c 100644 --- a/htdocs/forgot_pass_step_three.php +++ b/htdocs/forgot_pass_step_three.php @@ -1,59 +1,51 @@ - - - - + + + + - + - + Reset Password
    -
    -

    Xeorl

    +

    Xeorl

    Background Image -

    Unimited Shortens but,
    One Link at a Time

    +

    Unlimited Shortens but,
    One Link at a Time

    - -

    Create a New Password

    Please choose a password that hasn't been used before. Must be at least 8 characters.

    - -

    -
    diff --git a/htdocs/forgot_pass_step_two.php b/htdocs/forgot_pass_step_two.php index 186a8c16..9aea11a4 100644 --- a/htdocs/forgot_pass_step_two.php +++ b/htdocs/forgot_pass_step_two.php @@ -1,8 +1,8 @@ @@ -26,65 +26,48 @@ $email = isset($_SESSION['email']) ? $_SESSION['email'] : ''; // Retrieve the em
    - -
    -
    -

    Xeorl

    - +
    +
    +

    Xeorl

    + +
    +
    + Background Image +

    Unlimited Shortens but,
    One Link at a Time

    +
    -
    - Background Image -

    Unimited Shortens but,
    One Link at a Time

    -
    -
    - -

    Enter Confirmation Code

    We sent a code to

    - - -

    Didn't receive the email? Click to resend

    - -
    -
    - - - ' . htmlspecialchars($_SESSION['success_message']) . ''; - unset($_SESSION['success_message']); - } - ?> + + + + +
    - -
    - - - - \ No newline at end of file + diff --git a/htdocs/home.php b/htdocs/home.php index 19050517..376cbd65 100644 --- a/htdocs/home.php +++ b/htdocs/home.php @@ -1,8 +1,9 @@ @@ -24,7 +25,7 @@ ini_set('display_errors', 1); // Include the statistics file - +
    @@ -38,8 +39,7 @@ ini_set('display_errors', 1); // Include the statistics file
    @@ -58,19 +58,16 @@ ini_set('display_errors', 1); // Include the statistics file
    Total Clicks

    Total Clicks

    -

    Total Links

    Total URLs

    -

    Active Users

    Register Users

    -
    @@ -91,8 +88,10 @@ ini_set('display_errors', 1); // Include the statistics file
    + + - + diff --git a/htdocs/login.php b/htdocs/login.php index 740322fb..bb59c496 100644 --- a/htdocs/login.php +++ b/htdocs/login.php @@ -9,21 +9,20 @@ ini_set('display_errors', 1); - - - - + + + + - + - + Login
    -

    Xeorl

    @@ -34,29 +33,22 @@ ini_set('display_errors', 1);

    Unlocking Links,
    One Link at a Time

    - -

    Login to your account

    Don't have an account? Register

    - -
    Show Password
    - " . $_SESSION['error'] . "
    "; unset($_SESSION['error']); } ?> - -
    @@ -64,23 +56,16 @@ ini_set('display_errors', 1);
    Forgot password?
    - -

    This is a beta functionality. Please note that there are potential security concerns related to leaving your account logged in for long periods of time; especially when using an insecure, shared, or public device.

    - -
    Or login with
    -
    - diff --git a/htdocs/monetization.php b/htdocs/monetization.php index 56d2a160..31c24ee3 100644 --- a/htdocs/monetization.php +++ b/htdocs/monetization.php @@ -2,6 +2,7 @@ session_start(); error_reporting(E_ALL); ini_set('display_errors', 1); + if (!isset($_SESSION['user_id'])) { header("Location: login.php"); exit(); @@ -11,29 +12,28 @@ if (!isset($_SESSION['user_id'])) { - - + Monetization - - - - + + + + - + - -
    -

    Welcome, !

    -

    Email:

    - Logout -
    - + +
    +

    Welcome, !

    +

    Email:

    + Logout +
    + diff --git a/htdocs/password_reset_success.php b/htdocs/password_reset_success.php index fb771e59..81a526e4 100644 --- a/htdocs/password_reset_success.php +++ b/htdocs/password_reset_success.php @@ -3,12 +3,12 @@ - - - - + + + + - + @@ -17,38 +17,24 @@
    -
    -

    Xeorl

    +

    Xeorl

    Background Image -

    Unimited Shortens but,
    One Link at a Time

    +

    Unlimited Shortens but,
    One Link at a Time

    - -

    Password Reset!

    -

    - Your password has been successfully reset. - We understand that keeping your account secure is important, - and we're here to help you every step of the way. - You can now log in using your new password. - If you have any questions or need further assistance, - feel free to reach out to our support team at - support@xeorl.buzz. - Click the button below to log in and access your account. -

    - +

    Your password has been successfully reset. We understand that keeping your account secure is important, and we're here to help you every step of the way. You can now log in using your new password. If you have any questions or need further assistance, feel free to reach out to our support team at support@xeorl.buzz. Click the button below to log in and access your account.

    - diff --git a/htdocs/register.php b/htdocs/register.php index 50734015..213a50eb 100644 --- a/htdocs/register.php +++ b/htdocs/register.php @@ -1,5 +1,5 @@ @@ -9,12 +9,12 @@ ini_set('display_errors', 1); - - - - + + + + - + @@ -23,63 +23,63 @@ ini_set('display_errors', 1);
    -
    -

    Xeorl

    +

    Xeorl

    - Background Image + Background Image

    Capturing Links,
    One Link at a Time

    - -

    Create an account

    Already have an account? Log in

    -
    - -
    Show Password
    - - - " . $_SESSION['error'] . "
    "; - unset($_SESSION['error']); // Clear the error message after displaying it - } - ?> - - + +
    + +
    + +
    - + +
    + +
    + + + +
    Or register with
    -
    - + diff --git a/htdocs/unzipper.php b/htdocs/unzipper.php index 3b68cf57..7d2f138f 100644 --- a/htdocs/unzipper.php +++ b/htdocs/unzipper.php @@ -13,42 +13,40 @@ $redirect_url = $_SESSION['redirect_url']; - + Xeorl - Unzipper - - - - + + + + - + - -
    -
    -

    Your link is almost ready.

    -
    -
    - 10
    Seconds + +
    +
    +

    Your link is almost ready.

    +
    +
    + 10
    Seconds +
    +
    -
    -
    - - - - - - - + + + + + diff --git a/xeorl.sql b/xeorl.sql index 5db87ccf..5d88d0b0 100644 --- a/xeorl.sql +++ b/xeorl.sql @@ -3,7 +3,7 @@ -- https://www.phpmyadmin.net/ -- -- Host: localhost --- Generation Time: Jan 30, 2025 at 10:27 AM +-- Generation Time: Feb 05, 2025 at 08:28 AM -- Server version: 10.4.28-MariaDB -- PHP Version: 8.2.4 @@ -33,42 +33,23 @@ CREATE TABLE `url` ( `full_url` varchar(1000) NOT NULL, `clicks` int(11) NOT NULL, `total_links` int(11) DEFAULT 0, - `total_clicks` int(11) DEFAULT 0 + `total_clicks` int(11) DEFAULT 0, + `user_id` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; -- -- Dumping data for table `url` -- -INSERT INTO `url` (`id`, `shorten_url`, `full_url`, `clicks`, `total_links`, `total_clicks`) VALUES -(68, 'b1f6c', 'https://chatgpt.com/', 0, 0, 0), -(69, '11bd1', 'https://xeorl.buzz/', 0, 0, 0), -(70, '6d802', 'https://xeorl.buzz/', 0, 0, 0), -(71, 'ee620', 'https://xeorl.buzz/', 0, 0, 0), -(72, '685ce', 'https://xeorl.buzz/', 0, 0, 0), -(73, '9799d', 'https://xeorl.buzz/', 0, 0, 0), -(74, '759d9', 'https://xeorl.buzz/', 0, 0, 0), -(75, 'bb44e', 'https://xeorl.buzz/', 0, 0, 0), -(76, 'f79c1', 'https://xeorl.buzz/', 0, 0, 0), -(77, '8c834', 'https://xeorl.buzz/', 0, 0, 0), -(78, 'db107', 'https://xeorl.buzz/', 0, 0, 0), -(79, '925d9', 'https://xeorl.buzz/', 0, 0, 0), -(80, 'e2a22', 'https://xeorl.buzz/', 0, 0, 0), -(81, '4c9fe', 'https://xeorl.buzz/', 0, 0, 0), -(82, 'bb5a1', 'https://xeorl.buzz/', 0, 0, 0), -(83, '62809', 'https://xeorl.buzz/', 0, 0, 0), -(84, '10676', 'https://xeorl.buzz/', 0, 0, 0), -(85, 'f719f', 'https://xeorl.buzz/', 0, 0, 0), -(86, 'a3cc2', 'https://xeorl.buzz/', 0, 0, 0), -(87, '52fe9', 'https://prourl.eu.org/rwqe', 0, 0, 0), -(88, 'd3b17', 'https://www.xodivorce.in/?i=1', 0, 0, 0), -(89, '801d2', 'http://localhost/Php-Projects/xeorl/htdocs/', 0, 0, 0), -(90, '8819b', 'http://localhost/Php-Projects/xeorl/htdocs/home.php', 0, 0, 0), -(91, 'c8ff6', 'http://localhost/Php-Projects/xeorl/htdocs/home.php', 0, 0, 0), -(92, '25418', 'http://localhost/Php-Projects/xeorl/htdocs/', 0, 0, 0), -(93, 'ec04a', 'http://localhost/Php-Projects/xeorl/htdocs/', 0, 0, 0), -(94, 'c1234', 'http://localhost/Php-Projects/xeorl/htdocs/', 0, 0, 0), -(95, 'c6a56', 'https://www.xodivorce.in/?i=1', 0, 0, 0); +INSERT INTO `url` (`id`, `shorten_url`, `full_url`, `clicks`, `total_links`, `total_clicks`, `user_id`) VALUES +(68, 'b1f6c', 'https://chatgpt.com/', 0, 0, 0, NULL), +(87, '52fe9', 'https://prourl.eu.org/rwqe', 0, 0, 0, NULL), +(96, 'f49aa', 'https://www.xodivorce.in/', 6, 0, 0, NULL), +(103, '67191', 'https://github.com/xodivorce', 0, 0, 0, NULL), +(105, '4dfe6', 'https://www.blackbox.ai/', 0, 0, 0, NULL), +(112, '9500b', 'https://www.google.com/search?q=int+11+max+value+%3F&sca_esv=b71b87a039ad9bf1&sxsrf=AHTn8zqi--a95yrKigfA0Sd6b_9ixbSRLQ%3A1738710375024&ei=Z52iZ9mfAcGtseMP0L-DkAQ&ved=0ahUKEwiZ75TykKuLAxXBVmwGHdDfAEIQ4dUDCBA&uact=5&oq=int+11+max+value+%3F&gs_lp=Egxnd3Mtd2l6LXNlcnAiEmludCAxMSBtYXggdmFsdWUgPzIGEAAYFhgeMgYQABgWGB4yBhAAGBYYHjIGEAAYFhgeMgsQABiABBiGAxiKBTILEAAYgAQYhgMYigUyCxAAGIAEGIYDGIoFMgUQABjvBTIIEAAYgAQYogRIiwpQlgRY2ghwAXgBkAEAmAGvAaAB1AKqAQMwLjK4AQPIAQD4AQGYAgOgAuICwgIKEAAYsAMY1gQYR5gDAIgGAZAGCJIHAzEuMqAH5Ak&sclient=gws-wiz-serp', 0, 0, 0, NULL), +(116, '1dbcc', 'https://www.blackbox.ai/', 0, 0, 0, NULL), +(117, '2f909', 'https://chatgpt.com/', 2, 0, 0, NULL); -- -------------------------------------------------------- @@ -101,7 +82,8 @@ INSERT INTO `user` (`id`, `user_email`, `user_pass`, `user_otp`, `created_at`, ` -- Indexes for table `url` -- ALTER TABLE `url` - ADD PRIMARY KEY (`id`); + ADD PRIMARY KEY (`id`), + ADD KEY `fk_user_id` (`user_id`); -- -- Indexes for table `user` @@ -118,13 +100,23 @@ ALTER TABLE `user` -- AUTO_INCREMENT for table `url` -- ALTER TABLE `url` - MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=96; + MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=118; -- -- AUTO_INCREMENT for table `user` -- ALTER TABLE `user` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; + +-- +-- Constraints for dumped tables +-- + +-- +-- Constraints for table `url` +-- +ALTER TABLE `url` + ADD CONSTRAINT `fk_user_id` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE CASCADE; COMMIT; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;