When user come to site by link with activation code, his account activated (changed value in DB) and I want show some info message. For this I reload page with $_SESSION['message'] = "activated"
(same time removing activation code from URL). Info message block code:
<? if ($_SESSION['message'] === "activated") {
ShowAlert('ActivatedOk-popup');
echo '
<div id="ActivatedOk-popup" class="info-popup">
<div class="popup-info-wrapper"><div class="leaflet-popup-close-button">×</div>
<div class="popup-header">'.ACTIVATION_POP_HEADER.'</div>
<div class="popupRecord1">
<p>'.ACTIVATION_POP_TEXT1.$_SESSION['name'].ACTIVATION_POP_TEXT2.'</p>
</div>
<button class="popup-btn close_but">'.ACTIVATION_POP_BTN.'</button>
</div>
</div>';
unset($_SESSION['message']);
}
?>
But I can't understand why this pop-up doesn't appears. If I remove last line: $_SESSION['message'] = "";
everything work well, but Message variable isn't empty, and each page appears pop-up. How correctly show pop-up and then unset variable?