Files
intaleq_v3_pure_php/auth/sms/updatePhoneInvalidSMS.php
2026-04-28 13:04:27 +03:00

27 lines
775 B
PHP

<?php
// Include the database connection file
require_once __DIR__ . '/../../connect.php';
// Filter and encrypt the phone number input
$phone_number = filterRequest("phone_number");
$phone_number = $encryptionHelper->encryptData($phone_number);
// Prepare the SQL query to verify the phone
$sql = "UPDATE phone_verification SET is_verified = 1 WHERE phone_number = :phone_number";
// Prepare the statement
$stmt = $con->prepare($sql);
$stmt->bindParam(":phone_number", $phone_number);
// Execute the query
$stmt->execute();
$affectedRows = $stmt->rowCount();
// Check if the update was successful
if ($affectedRows > 0) {
jsonSuccess(["message" => "Phone number verified successfully"]);
} else {
jsonError("No phone number found or verification failed");
}
?>