Jump to content

Recommended Posts

Hello all.

I am having an issue with a page that contains a form. The form submits to itself.

The button used to submit the form is a <button..> with an onclick that validates some data then does a document.frm1.submit(); if all data checks out.

I have these headers set:
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
Header('Pragma: no-cache');

My issue is that sometimes, and I cannot recreate regulary, after clicking the button I get a "Page Cannot Be Displayed" error. I click the browser's back button, and all form data is gone, I hit the button and again "Page Cannot Be Displayed". I can hit back and then the button over and over with same "Page Cannot Be Displayed". Now when on the "Page Cannot Be Displayed" if I refresh it first asks if I want to resubmit data, I click yes and the page will load but the data submitted is not there. NOW if I hit back and then hit the button it will submit just fine. The refresh is needed to fix the issue. I have not found a pattern that will cause the "Page Cannot Be Displayed" error.

Any help would be greatly appreciated.
Link to comment
https://forums.phpfreaks.com/topic/6017-page-not-found/
Share on other sites

My first 8 lines

require("../connect.php");
require("../fun-general.php");
require("../func-contractor.php");
require("../func_owner.php");

header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
Header('Pragma: no-cache');


The button has an onclick event that uses javascript to make sure certain fields are completed. If they are completed then submits.

<input onClick="return ButtonSubmit( 'Stay' )" type="button" value="Save">

function ButtonSubmit( StayOrReturn )
{
ret = true ;
if (eval(frm1.days_complete.value)==0 || frm1.days_complete.value=="")
ret = false ;
if( ret != false )
{
alert( "Saving this Cost Breakdown Sheet does NOT submit." )
document.frm1.savecbs.value="Save CBS"
document.frm1.float_submit.value="Save CBS"
document.frm1.Stay_Or_Return.value=StayOrReturn
document.frm1.submit();
}
else
{
return false;
}
}




Link to comment
https://forums.phpfreaks.com/topic/6017-page-not-found/#findComment-21614
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.