I wish after echo can wait about 2 second then move to another page ? how to do that ? using jquery ?
if($theme_added)
{
echo "Theme has been successfully added.";
window.location.href="manage_party_info.php";
}
I wish after echo can wait about 2 second then move to another page ? how to do that ? using jquery ?
if($theme_added)
{
echo "Theme has been successfully added.";
window.location.href="manage_party_info.php";
}
You can try:
header('refresh: 2; url=http://www.example.net');
2 = number of seconds; url = adress
For an instant redirect, you would do header("Location: manage_party_info.ph");
For a delayed one, however, you can output some JavaScript, or use a "meta refresh":
header("Refresh: 3; url=manage_party_info.php");
die("<p>Theme has been successfully added.</p>"
."<p>You will be redirected. Please <a href=\"manage_party_info.php\">click here</a> if this page appears for more than five seconds.</p>");
Notice how I added a manual alternative with the link. This is an essential usability thing, because some users may have disabled the Refresh header in their browser (as it can be and sometimes is used for malicious purposes). You will face this problem if you use JavaScript/jQuery too, because users can disable JS.