Repository navigation
Expand file tree
/
Copy pathsubmit-review.php
More file actions
150 lines (134 loc) · 6.82 KB
/
Copy pathsubmit-review.php
File metadata and controls
150 lines (134 loc) · 6.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
<?php
require_once 'includes/db.php';
require_once 'includes/functions.php';
$message = '';
$error = '';
if (!isset($_SESSION['captcha_a']) || !isset($_SESSION['captcha_b'])) {
$_SESSION['captcha_a'] = rand(1, 10);
$_SESSION['captcha_b'] = rand(1, 10);
}
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$name = trim($_POST['name'] ?? '');
$email = trim($_POST['email'] ?? '');
$service = $_POST['service'] ?? '';
$rating = (int)($_POST['rating'] ?? 0);
$review_text = trim($_POST['review_text'] ?? '');
$captcha_input = (int)($_POST['captcha'] ?? 0);
if (empty($name) || empty($service) || $rating < 1 || $rating > 5 || empty($review_text)) {
$error = "MISSING REQUIRED DATA NODES.";
} elseif ($captcha_input !== ($_SESSION['captcha_a'] + $_SESSION['captcha_b'])) {
$error = "SECURITY PROTOCOL FAILED. INCORRECT SUM.";
} else {
try {
$stmt = $pdo->prepare("INSERT INTO reviews (name, email, service, rating, review_text, ip_address, status) VALUES (?, ?, ?, ?, ?, ?, 'pending')");
if ($stmt->execute([$name, $email, $service, $rating, $review_text, $_SERVER['REMOTE_ADDR']])) {
// NOTIFY ADMIN
$admin_email = 'support@exploitinject.dev'; // Replace with actual admin email
$subject = "[NEW REVIEW] " . strtoupper($service) . " - " . $name;
$msg = "
<p>New review received for <span class='accent'>$service</span>.</p>
<p><strong>Entity:</strong> $name</p>
<p><strong>Rating:</strong> $rating / 5</p>
<p><strong>Review Text:</strong><br><em>$review_text</em></p>
<br>
<a href='https://review.exploitinject.dev/admin' style='display: inline-block; padding: 10px 20px; background: #0066ff; color: #fff; text-decoration: none;'>APPROVE REVIEW</a>
";
send_custom_email($admin_email, $subject, $msg);
$message = "DATA TRANSMITTED. AWAITING MODERATOR CLEARANCE.";
$_SESSION['captcha_a'] = rand(1, 10);
$_SESSION['captcha_b'] = rand(1, 10);
}
} catch (PDOException $e) {
$error = "SYSTEM ERROR. TRANSMISSION ABORTED.";
}
}
}
require_once 'partials/header.php';
?>
<main class="container" style="padding: 150px 0;">
<div style="max-width: 800px; margin: 0 auto;">
<h1 class="syncopate gradient-text" style="font-size: 3rem; margin-bottom: 1rem;">Data Input</h1>
<p style="color: var(--text-muted); margin-bottom: 5rem; text-transform: uppercase; letter-spacing: 2px; font-size: 0.8rem;">
Submit your verification proof for ExploitInject service delivery.
</p>
<?php if($message): ?>
<div style="padding: 2rem; border: 1px solid var(--accent-primary); color: var(--accent-primary); margin-bottom: 4rem; font-family: 'Syncopate'; font-size: 0.8rem;">
[SUCCESS] <?php echo $message; ?>
</div>
<?php endif; ?>
<?php if($error): ?>
<div style="padding: 2rem; border: 1px solid #ff0055; color: #ff0055; margin-bottom: 4rem; font-family: 'Syncopate'; font-size: 0.8rem;">
[ERROR] <?php echo $error; ?>
</div>
<?php endif; ?>
<form action="submit-review.php" method="POST" class="form-card reveal">
<div style="display: grid; grid-template-columns: 1fr 1fr; gap: 4rem;">
<div class="input-group">
<label class="input-label">Identity (Full Name)</label>
<input type="text" name="name" class="input-field" required placeholder="JOHN DOE">
</div>
<div class="input-group">
<label class="input-label">Contact (Email - Optional)</label>
<input type="email" name="email" class="input-field" placeholder="DECODED@EXAMPLE.COM">
</div>
</div>
<div style="display: grid; grid-template-columns: 1fr 1fr; gap: 4rem;">
<div class="input-group">
<label class="input-label">Service Stream</label>
<select name="service" class="input-field" required style="background: var(--bg-card);">
<option value="">SELECT STREAM</option>
<option value="SEO Optimization">SEO OPTIMIZATION</option>
<option value="Digital Marketing">DIGITAL MARKETING</option>
<option value="Web Development">WEB DEVELOPMENT</option>
<option value="Cyber Security">CYBER SECURITY</option>
<option value="Branding & Design">BRANDING & DESIGN</option>
</select>
</div>
<div class="input-group">
<label class="input-label">Score (1-5)</label>
<div style="display: flex; gap: 1rem; margin-top: 1rem;">
<?php for($i=1; $i<=5; $i++): ?>
<label style="cursor: pointer;">
<input type="radio" name="rating" value="<?php echo $i; ?>" required style="display: none;">
<span class="rating-box"><?php echo $i; ?></span>
</label>
<?php endfor; ?>
</div>
</div>
</div>
<div class="input-group">
<label class="input-label">Verification Details (Review Text)</label>
<textarea name="review_text" class="input-field" rows="4" required placeholder="DESCRIBE YOUR EXPERIENCE..."></textarea>
</div>
<div class="input-group">
<label class="input-label">Security Key (<?php echo $_SESSION['captcha_a']; ?> + <?php echo $_SESSION['captcha_b']; ?>)</label>
<input type="number" name="captcha" class="input-field" required placeholder="ENTER SUM">
</div>
<button type="submit" class="btn btn-primary" style="width: 100%; justify-content: center;">
Transmit Data <i data-lucide="arrow-right"></i>
</button>
</form>
</div>
</main>
<style>
.rating-box {
display: flex;
width: 40px;
height: 40px;
border: 1px solid var(--border-color);
align-items: center;
justify-content: center;
transition: var(--transition);
font-weight: 700;
}
input[type="radio"]:checked + .rating-box {
background: var(--accent-primary);
color: #fff;
border-color: var(--accent-primary);
box-shadow: 0 0 15px var(--accent-primary);
}
.rating-box:hover {
border-color: var(--accent-primary);
}
</style>
<?php require_once 'partials/footer.php'; ?>