admin 9
This commit is contained in:
@@ -7,18 +7,14 @@ $phone = filterRequest("phone");
|
||||
// Encrypt phone
|
||||
$encphone = $encryptionHelper->encryptData($phone);
|
||||
|
||||
$sql = "SELECT
|
||||
*
|
||||
FROM
|
||||
`driver`
|
||||
WHERE
|
||||
phone = :encPhone";
|
||||
error_log("[GIFT_CHECK] Received Phone: " . $phone);
|
||||
error_log("[GIFT_CHECK] Encrypted Phone: " . $encphone);
|
||||
|
||||
$sql = "SELECT * FROM `driver` WHERE phone = :encPhone OR phone = :rawPhone";
|
||||
|
||||
$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(':rawPhone', $phone, PDO::PARAM_STR);
|
||||
|
||||
$stmt->execute();
|
||||
|
||||
|
||||
13
check_driver_phones.php
Normal file
13
check_driver_phones.php
Normal 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();
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user