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
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>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.