i currently have my site configured so that when a user logs in they are navigated to the home page of my site and they get a welcome message within a session. the bit im having trouble with is finding a way to timeout or close this message or chage the css settings to display:none after 3 seconds.
Can someone please show me how i could add a time out function onto this, heres what i got so far, thanks.
User logs in using html login form, this submits and goes to login.php:
inside login.php i have this:
<?php
if (logged_in())
{
$_SESSION['login_message']="<div class=\"login-overlay\">
<h1>Login You In Securely</h1></div>";
header("Location:home.php");
}
?>Then inside home.php i have this:
<?
session_start();
if(isset($_SESSION['login_message'] )) echo $_SESSION['login_message']; unset($_SESSION['login_message']) ;
?>how can i add a 3 second rule to this so that it only shows for 3 seconds thanks.
12 Answers
Use javascript.
setTimeout(function() { document.getElementById("message").style.display = 'none';
}, 3000); You can use jquery,
$(function(){ setTimeout(function() { $("#message").hide('slow'); }, 3000);
});