This commit is contained in:
Hamza-Ayed
2026-04-30 17:34:02 +03:00
parent b602106b79
commit 24d38160c0
2 changed files with 18 additions and 9 deletions

View File

@@ -7,18 +7,14 @@ $phone = filterRequest("phone");
// Encrypt phone // Encrypt phone
$encphone = $encryptionHelper->encryptData($phone); $encphone = $encryptionHelper->encryptData($phone);
$sql = "SELECT error_log("[GIFT_CHECK] Received Phone: " . $phone);
* error_log("[GIFT_CHECK] Encrypted Phone: " . $encphone);
FROM
`driver` $sql = "SELECT * FROM `driver` WHERE phone = :encPhone OR phone = :rawPhone";
WHERE
phone = :encPhone";
$stmt = $con->prepare($sql); $stmt = $con->prepare($sql);
// FIX 1: Bind AFTER preparing the statement
// FIX 2: Use the same placeholder name (:encPhone)
$stmt->bindParam(':encPhone', $encphone, PDO::PARAM_STR); $stmt->bindParam(':encPhone', $encphone, PDO::PARAM_STR);
$stmt->bindParam(':rawPhone', $phone, PDO::PARAM_STR);
$stmt->execute(); $stmt->execute();

13
check_driver_phones.php Normal file
View File

@@ -0,0 +1,13 @@
<?php
require_once 'connect.php';
try {
$stmt = $con->query("SELECT phone FROM driver LIMIT 10");
$rows = $stmt->fetchAll(PDO::FETCH_ASSOC);
foreach ($rows as $row) {
echo "Raw: " . $row['phone'] . " | Decrypted: " . $encryptionHelper->decryptData($row['phone']) . "\n";
}
} catch (Exception $e) {
echo $e->getMessage();
}
?>