[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: offline_ticket_momo.php
<?php include("functions.php"); if(!isset($_SESSION['username_Xw21erAAsqg4'])){ header("Location: index"); exit(); } else { $username = $_SESSION['username_Xw21erAAsqg4']; $gettype = mysqli_query($new,"SELECT * FROM admin WHERE username = '$username'"); $type1 = mysqli_fetch_array($gettype); $mytype = $type1['type']; $message = ""; // Check if form submitted if($_SERVER["REQUEST_METHOD"] == "POST"){ if(!csrf_token_is_valid() || !csrf_token_is_recent()) { $message = "<p class='alert alert-danger text-center ' role='alert'>Token Authentication Failed</p>"; } else { // Sanitize input $name = test_input($_POST['name']); $phone = test_input($_POST['phone']); $email = test_input($_POST['email']); // Basic validation if (empty($name) || empty($phone) || empty($email)) { die("Please fill in all fields."); } if (!preg_match('/^[0-9]{10,15}$/', $phone)) { die("Invalid phone number."); } if (!filter_var($email, FILTER_VALIDATE_EMAIL)) { die("Invalid email format."); } // Check if email already exists // $checkStmt = $con->prepare("SELECT email FROM users WHERE email = ?"); // $checkStmt->execute([$email]); // $_SESSION['phone'] = $phone; // $_SESSION['user_email'] = $email; // if ($checkStmt->fetch()) { // // Email exists, show error modal // echo ' // <!DOCTYPE html> // <html lang="en"> // <head> // <meta charset="UTF-8"> // <meta name="viewport" content="width=device-width, initial-scale=1.0"> // <title>Registration Error</title> // <style> // .modal-overlay { // display: flex; // justify-content: center; // align-items: center; // position: fixed; // top: 0; // left: 0; // width: 100%; // height: 100%; // background-color: rgba(0, 0, 0, 0.5); // z-index: 1000; // } // .modal-content { // font-family: Arial, sans-serif; // color: #dc3545; // background-color: #f8d7da; // padding: 20px; // border-radius: 5px; // text-align: center; // width: 80%; // max-width: 500px; // box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); // animation: fadeIn 0.3s ease-in; // } // @keyframes fadeIn { // from { opacity: 0; transform: scale(0.8); } // to { opacity: 1; transform: scale(1); } // } // </style> // </head> // <body> // <div class="modal-overlay"> // <div class="modal-content"> // Email already exists! Please use! Redirecting... // </div> // <script> // setTimeout(function() { // window.location.href = "momopayment"; // Replace with your target page // }, 3000); // </script> // </body> // </html>'; // exit(); // } // Insert into users table $stmt = $con->prepare("INSERT INTO users (name, phone, email) VALUES (?, ?, ?)"); $stmt->execute([$name, $phone, $email]); $_SESSION['user_email'] = $email; $_SESSION['phone'] = $phone; // Output success modal echo ' <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Registration Successful</title> <style> .modal-overlay { display: flex; justify-content: center; align-items: center; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.5); z-index: 1000; } .modal-content { font-family: Arial, sans-serif; color: #28a745; background-color: #d4edda; padding: 20px; border-radius: 5px; text-align: center; width: 80%; max-width: 500px; box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); animation: fadeIn 0.3s ease-in; } @keyframes fadeIn { from { opacity: 0; transform: scale(0.8); } to { opacity: 1; transform: scale(1); } } </style> </head> <body> <div class="modal-overlay"> <div class="modal-content"> Registration successful! Redirecting... </div> </div> <script> setTimeout(function() { window.location.href = "momopayment"; // Replace with your target page }, 3000); </script> </body> </html>'; exit(); } } } ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <!-- Boxicons --> <link href='https://unpkg.com/boxicons@2.0.9/css/boxicons.min.css' rel='stylesheet'> <!-- My CSS --> <link rel="stylesheet" href="style.css"> <title>Offline Ticketing : <?php echo $username;?></title> <style> .order form { max-width: 400px; margin: 20px auto; padding: 20px; background: #f8f9fa; border-radius: 10px; box-shadow: 0 2px 10px rgba(0,0,0,0.1); font-family: Arial, sans-serif; } .order form div { margin-bottom: 15px; } .order label { display: block; margin-bottom: 5px; font-weight: bold; color: #333; } .order input[type="text"], .order input[type="email"], .order input[type="tel"] { width: 100%; padding: 10px; border: 1px solid #ccc; border-radius: 6px; font-size: 14px; box-sizing: border-box; } .order button { padding: 10px 20px; background-color: #007bff; border: none; border-radius: 6px; color: white; font-size: 16px; cursor: pointer; transition: background-color 0.3s ease; } .order button:hover { background-color: #0056b3; } .error-message { color: red; font-size: 0.9em; margin-top: 5px; } </style> </head> <body> <!-- SIDEBAR --> <?php if($mytype == 'user'){?> <section id="sidebar"> <a href="dashboard" class="brand"> <i class='bx bxs-smile'></i> <span class="text"><?php echo $username;?></span> </a> <ul class="side-menu top"> <li class="active"> <a href="dashboard"> <i class='bx bxs-dashboard' ></i> <span class="text">Dashboard</span> </a> </li> <li> <a href="offline_ticket"> <i class='bx bxs-shopping-bag-alt' ></i> <span class="text">Gate Ticket (Cash)</span> </a> </li> <li> <a href="offline_ticket_momo"> <i class='bx bxs-shopping-bag-alt' ></i> <span class="text">Gate Ticket (Momo)</span> </a> </li> <li> <a href="verify_ticket"> <i class='bx bxs-doughnut-chart' ></i> <span class="text">Verify Ticket</span> </a> </li> </ul> <ul class="side-menu"> <li> <a href="change-password"> <i class='bx bxs-cog' ></i> <span class="text">Change password</span> </a> </li> <li> <a href="logout" class="logout"> <i class='bx bxs-log-out-circle' ></i> <span class="text">Logout</span> </a> </li> </ul> </section> <?php } else{?> <section id="sidebar"> <a href="dashboard" class="brand"> <i class='bx bxs-smile'></i> <span class="text"><?php echo $username;?></span> </a> <ul class="side-menu top"> <li class="active"> <a href="dashboard"> <i class='bx bxs-dashboard' ></i> <span class="text">Dashboard</span> </a> </li> <li> <a href="verify_ticket"> <i class='bx bxs-doughnut-chart' ></i> <span class="text">Verify Ticket</span> </a> </li> <li> <a href="offline_ticket"> <i class='bx bxs-shopping-bag-alt' ></i> <span class="text">Gate Ticket(Cash)</span> </a> </li> <li> <a href="offline_ticket_momo"> <i class='bx bxs-shopping-bag-alt' ></i> <span class="text">Gate Ticket(Momo)</span> </a> </li> <li> <a href="all-tickets"> <i class='bx bxs-shopping-bag-alt' ></i> <span class="text">All Tickets</span> </a> </li> <li> <a href="verified"> <i class='bx bxs-doughnut-chart' ></i> <span class="text">All verified Tickets</span> </a> </li> <li> <a href="unverified"> <i class='bx bxs-message-dots' ></i> <span class="text">Unverified Tickets</span> </a> </li> <li> <a href="users"> <i class='bx bxs-group' ></i> <span class="text">Team</span> </a> </li> <li> <a href="finance"> <i class='bx bxs-group' ></i> <span class="text">Finance</span> </a> </li> </ul> <ul class="side-menu"> <li> <a href="change-password"> <i class='bx bxs-cog' ></i> <span class="text">Change password</span> </a> </li> <li> <a href="logout" class="logout"> <i class='bx bxs-log-out-circle' ></i> <span class="text">Logout</span> </a> </li> </ul> </section> <?php }?> <!-- SIDEBAR --> <!-- CONTENT --> <section id="content"> <!-- NAVBAR --> <nav> <i class='bx bx-menu' ></i> <a href="#" class="nav-link">Offline Ticket</a> <form action="#"> <div class="form-input"> <input type="search" placeholder="Search..."> <button type="submit" class="search-btn"><i class='bx bx-search' ></i></button> </div> </form> <input type="checkbox" id="switch-mode" hidden> <label for="switch-mode" class="switch-mode"></label> </nav> <!-- NAVBAR --> <!-- MAIN --> <main> <div class="table-data"> <div class="order"> <center><he>Buy Gate Ticket (Momo)</he></center> <form id="registrationForm" method="POST" onsubmit="return validateForm()"> <?php echo csrf_token_tag(); ?> <div> <label for="name">Name:</label> <input type="text" id="name" name="name"> <div class="error-message" id="nameError"></div> </div> <div> <label for="email">Email:</label> <input type="email" id="email" name="email"> <div class="error-message" id="emailError"></div> </div> <div> <label for="phone">Phone Number:</label> <input type="tel" id="phone" name="phone"> <div class="error-message" id="phoneError"></div> </div> <button type="submit" name="submit">Submit</button> </form> </div> </div> </main> <!-- MAIN --> </section> <!-- CONTENT --> <script> function validateForm() { let isValid = true; // Get input values const name = document.getElementById('name').value.trim(); const phone = document.getElementById('phone').value.trim(); const email = document.getElementById('email').value.trim(); // Get error divs const nameError = document.getElementById('nameError'); const phoneError = document.getElementById('phoneError'); const emailError = document.getElementById('emailError'); // Clear previous error messages nameError.textContent = ''; phoneError.textContent = ''; emailError.textContent = ''; // Validate name if (name === '') { nameError.textContent = 'Please enter your name.'; isValid = false; } // Validate phone const phoneRegex = /^[0-9]{10,15}$/; if (!phoneRegex.test(phone)) { phoneError.textContent = 'Enter a valid phone number (10–15 digits).'; isValid = false; } // Validate email const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/; if (!emailRegex.test(email)) { emailError.textContent = 'Please enter a valid email address.'; isValid = false; } return isValid; } </script> <script src="script.js"></script> </body> </html>
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: server1.winmanyltd.com
Server IP: 203.161.60.52
PHP Version: 8.3.27
Server Software: Apache
System: Linux server1.winmanyltd.com 4.18.0-553.22.1.el8_10.x86_64 #1 SMP Tue Sep 24 05:16:59 EDT 2024 x86_64
HDD Total: 117.98 GB
HDD Free: 60.07 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Enabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes (py3)
gcc:
Yes
pkexec:
Yes
git:
Yes
User Info
Username: eliosofonline
User ID (UID): 1002
Group ID (GID): 1003
Script Owner UID: 1002
Current Dir Owner: 1002