let's look at the problem areas
if (isset($artist['banned']) && $artist['banned'] === 'true') {
echo '<div class="alert alert-danger text-center">🚫 This artist has been banned. Their profile is restricted.</div>';
exit;
}
In the above, you are comparing to 'true'
, which is a string and will not be identical to the boolean true
that is contained in the JSON.
In the second case:
<?php if (!empty($artist['status']) && $artist['suspended'] === 'true'): ?>
<div class="alert alert-warning mt-2">⚠️ This artist is currently suspended. Their activity may be limited.</div>
<?php endif; ?>
You not only have the same problem as with banned
, but in addition you are checking if something called status
is not empty, and not checking if suspended
is set. That behavior may or may not be the logic you want.