monkeybidz Posted September 29, 2007 Share Posted September 29, 2007 I have a form that will not submit if certain data cannot be found in Mysql or it will take very long to submit. Is there a way i can have the form go to an error page if it does not submit or load results in 5 seconds. If it does take long i need the following: $msg[] = $error10; header("Location: quote_error.php?"); Thanks in advance! Quote Link to comment https://forums.phpfreaks.com/topic/71198-solved-redirect-if-page-does-not-load/ Share on other sites More sharing options...
desithugg Posted September 30, 2007 Share Posted September 30, 2007 Umm I didn't quite understand what you want but here's what I think you're looking for. A bit of javascript. <head> <script language='javascript'> function checkForm(){ document.theForm.submit(); setTimeout("location.href = 'errorpage.php';",5000); } </script> </head> <form name='theForm' action="submit.php" method="post"> <input type='button' onclick="checkForm();"> </form> Quote Link to comment https://forums.phpfreaks.com/topic/71198-solved-redirect-if-page-does-not-load/#findComment-358159 Share on other sites More sharing options...
monkeybidz Posted September 30, 2007 Author Share Posted September 30, 2007 Thanks, thats exactly what i was looking for. Quote Link to comment https://forums.phpfreaks.com/topic/71198-solved-redirect-if-page-does-not-load/#findComment-358172 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.