In first version you are missing the other condition ($_SESSION['iiio'] != "pending"). In that case the div is shown by default.
It looks like you are using Bootstrap so you can use the show
and hidden
classes provided by Bootstrap. I am using ternary expression here since it is most convenient:
<div class="<?php echo $_SESSION['iiio'] == "pending" ? 'show' : 'hidden';?>"
<a href="https://www.paymentgateway.com">
<button align="right" id="completeReg" name="completeReg" class="btn btn-danger my-cart-btn my-cart-b" >Complete RegistrationComplete Registration</button>
</a>
</div>
If you are not using Bootstrap then create the two classes yourself:
.show {
display: block;
}
.hidden {
display: none;
}