Jump to content

[SOLVED] Redirect if page does not load


monkeybidz

Recommended Posts

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!

Link to comment
https://forums.phpfreaks.com/topic/71198-solved-redirect-if-page-does-not-load/
Share on other sites

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>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.