Search code examples
phpfunctionsleeppage-refresh

Holding php function for 4 second and then refresh the page


I want to hold an echo function for 4 seconds and after that refresh the php page but instead sleep() function holds all of echo functions and then refresh the page. this is my code how can I fix this ?

if($sql_new!='')
{
  $_SESSION["count"]="";

  echo "<div class='cleaner h30'></div>";
  echo "<b'>Inbox informations Submitted successfully!</b>";
  sleep(4);
  echo "<meta http-equiv=\"refresh\" content=\"0;URL=inbox.php\">";    
}

Solution

  • echo "<meta http-equiv=\"refresh\" content=\"4;URL=inbox.php\">";
    

    change 0 to 4 can do this