svgmx5 Posted December 29, 2010 Share Posted December 29, 2010 quick questions.. i have this code echo '<p>message of error</p>'; echo"<script type='text/javascript'> window.location='index.php'</script>"; and i want to know how could i delay the redirect to index.php for about 5 seconds or so? i've found how to do it using header(); but I've used that before and have gotten alot of errors, which is why i use on javascript to do it for me. Quote Link to comment Share on other sites More sharing options...
lastkarrde Posted December 29, 2010 Share Posted December 29, 2010 Use Javascript's timing functions combined with window.location = 'index.php'; Quote Link to comment Share on other sites More sharing options...
Zurev Posted December 29, 2010 Share Posted December 29, 2010 You could also use php's sleep function, in case the end user has javascript disabled. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.