[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: verifythis.php
<?php include("functions.php"); // Get query parameters $message = ""; if ($_SERVER['REQUEST_METHOD'] === 'POST') { $thiscode = $_POST['thiscode']; $phone = $_POST['phone']; // ✅ Send SMS with access code $senderID = "BBECAS"; $data = json_encode([ 'username' => "bbecas", 'password' => "bbeduconsult456@gmail.com", 'source' => $senderID, 'destination'=> $phone, 'message' => "Your Access Code is: $accessCode", 'ol' => false, ]); $curl = curl_init(); curl_setopt_array($curl, [ CURLOPT_URL => 'https://deywuro.com/api/sms', CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => '', CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => 'POST', CURLOPT_POSTFIELDS => $data, CURLOPT_HTTPHEADER => [ 'Accept: application/json', 'Content-Type: application/json', ], ]); $sms_response = curl_exec($curl); $sms_err = curl_error($curl); curl_close($curl); if ($sms_err) { $message = "<h3 style='color:orange; text-align:center;'>Phone saved ✅ but SMS failed ❌ : $sms_err</h3>"; } else { $message = "<h3 style='color:green; text-align:center;'>Phone saved ✅ and SMS sent successfully 📩</h3>"; } $message = "<p style='text-align:center;'><a href='login.php' class='btn btn-primary mt-3'>Go to Login</a></p>"; $stmt2->close(); } $reference = $_GET['reference'] ?? ''; $schoolCode = $_GET['schoolCode'] ?? ''; $indexNo = $_GET['indexNo'] ?? ''; if (!$reference) { die("No transaction reference supplied"); } // Verify with Paystack $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "https://api.paystack.co/transaction/verify/" . urlencode($reference)); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, [ "Authorization: Bearer sk_live_c472f0bd96452d599a6bc760e943f1915566d5c9", // 🔑 your Paystack SECRET key "Cache-Control: no-cache", ]); $response = curl_exec($ch); if (curl_errno($ch)) { die("Curl error: " . curl_error($ch)); } curl_close($ch); $result = json_decode($response, true); if ($result['status'] && $result['data']['status'] === 'success') { // Payment successful $amountPaid = $result['data']['amount'] / 100; // Convert from pesewas $transactionId = $result['data']['reference']; // same as ref $accessCode = $transactionId; $pstatus = "Paid"; $datepaid = date("Y-m-d H:i:s"); // Insert into stud_payment $stmt = $new->prepare("INSERT INTO stud_payment (s_code, indexNumber, amount, pstatus, datepaid, transaction_id, access_code) VALUES (?, ?, ?, ?, ?, ?, ?)"); $stmt->bind_param("ssdssss", $schoolCode, $indexNo, $amountPaid, $pstatus, $datepaid, $transactionId, $accessCode); if ($stmt->execute()) { $updateQuery = "UPDATE enrol_generic SET access = '$transactionId' WHERE indexNo = '$indexNo' AND s_code = '$schoolCode'"; if (!mysqli_query($new, $updateQuery)) { } ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Payment Successful</title> <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet"> </head> <body class="bg-light d-flex align-items-center justify-content-center vh-100"> <div class="card shadow-lg p-4 text-center" style="max-width: 500px;"> <div class="mb-3"> <svg xmlns="http://www.w3.org/2000/svg" width="80" height="80" fill="green" class="bi bi-check-circle-fill" viewBox="0 0 16 16"> <path d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zM6.97 10.97l-3.5-3.5a.75.75 0 1 1 1.06-1.06L7 9.44l4.47-4.47a.75.75 0 0 1 1.06 1.06l-5 5a.75.75 0 0 1-1.06 0z"/> </svg> </div> <h3 class="text-success">Enter your phone number to receive your code!</h3> <form method="POST"> <div class="mb-3"> <label for="phone" class="form-label fw-bold">Enter Your Phone Number</label> <input type="tel" name="phone" id="phone" class="form-control" placeholder="e.g. 0241234567" required pattern="[0-9]{10}"> <div class="form-text">Enter a valid 10-digit Ghanaian phone number.</div> <input type="hidden" name="thiscodel" value="<?php echo $accessCode;?>"> </div> <button type="submit" class="btn btn-success w-100">Submit Phone Number</button> </form> <?php echo $message;?> </div> </body> </html> <?php } else { echo "Database Error: " . $stmt->error; } $stmt->close(); } else { // Payment failed echo "<h2>❌ Payment Verification Failed</h2>"; echo "<pre>" . print_r($result, true) . "</pre>"; } $new->close();
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