php session error why session is unavailable to the page when i use unset after echo it (session).
and when i comment unset(), then i am able to see it on the page ? what's issue with it :(
my code
<div class="fixed bg-blue-500 text-white py-2 px-4 rounded-xl bottom-3 right-3">test
<?php if(isset($_SESSION['register'])) :?>
<span class="session fixed bg-blue-500 text-white py-2 px-4 rounded-xl bottom-3 right-3">
<?php echo $_SESSION['register']; ?>
</span>
<?php unset($_SESSION['register']) ?>
<?php endif ?>
</div>
@shivamyadav Try this:
<div class="fixed bg-blue-500 text-white py-2 px-4 rounded-xl bottom-3 right-3">test
<?php if(isset($_SESSION['register'])) :?>
<span class="session fixed bg-blue-500 text-white py-2 px-4 rounded-xl bottom-3 right-3">
<?php echo $_SESSION['register']; ?>
</span>
<?php endif ?>
</div>
<?php unset($_SESSION['register']) ?>
Please sign in or create an account to participate in this conversation.