false]; if ($token && $handphone) { $stmt = $pdo->prepare("SELECT id FROM agen_voucher WHERE nomor_whatsapp = :handphone AND token = :token"); $stmt->bindParam(':handphone', $handphone, PDO::PARAM_STR); $stmt->bindParam(':token', $token, PDO::PARAM_STR); $stmt->execute(); if ($user = $stmt->fetch(PDO::FETCH_ASSOC)) { $_SESSION['agen'] = $user['id']; $response['valid'] = true; $response['userId'] = $user['id']; } else { session_destroy(); } } echo json_encode($response);