John Davidson

php - delay asked for $_SESSION['message']

0 comments
Message:


I would like a success message to disappear after 3 seconds.


This is my PHP code:


if(!empty($_SESSION['message'])){
echo '<div class="alert alert-success" role="alert"> '.$_SESSION['message'].'</div>';
$_SESSION['message'] = "";
}


My Answer:
delay'] = 5;

This code sets a delay of 5 seconds for the session variable $_SESSION['delay']. This means that the value stored in $_SESSION['delay'] will be available for 5 seconds before it expires.

Rate this post

5 of 5 based on 3334 votes

Comments




© 2024 Hayatsk.info - Personal Blogs Platform. All Rights Reserved.
Create blog  |  Privacy Policy  |  Terms & Conditions  |  Contact Us