I’m trying to get a website up and running for a Child Support Calculator.
The calculator is invoked by html (ACSCalcV3.0.html in htdocs folder) with embedded Javascript which, when the calculate button is clicked, should POST data to a PHP routine via the line
obj.open('POST','ACSCalcV3.0.php',true);
This should then return the html to be displayed and a div<br><br>The entire function being <br><pre class="CodeBlock">`<div>//================================================================================================ <span>// Invoke the PHP CS Calculation routines passing the extracted delimited string and waiting for </span><span>// the return of the resultant html and then apply this to the results div </span><span>//================================================================================================ </span><span>function calcCS(r) { </span><span> var obj = newRequestObject(), msg = document.getElementById('calcdone'); </span><span> obj.onreadystatechange = function() { </span><span> if (obj.readyState == 4) { </span><span> if (obj.status == 200) { </span><span> rtext = obj.responseText </span><span> var b = document.getElementById('results'+AC_browser); </span><span> b.innerHTML = rtext; </span><span> delete obj; </span><span> obj = null; </span><span> } </span><span> } </span><span> } </span><span> obj.open('POST','ACSCalcV3.0.php',true); </span><span> obj.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); </span><span> obj.send('CSINFO='+encodeURI(r)); </span><span> msg.style.display = 'block'; </span><span> setTimeout("document.getElementById('calcdone').style.display='none'",1000); </span>}</div>`
The Javascript is working fine and a breakpoint on the line that does the POST is reached when the button is clicked (other aspects such as mouseovers in the JavaScript are all working).
I've also checked that PHP itself is enabled using phpinfo.
However, the PHP script/rotine ACSCalcV3.0.0.php which is in a directory called include doesn't appear to be being invoked.
There doesn't appear to be any relevant error messages and .htaccess includes php_value display_errors On
When the ready state is 4 the status is 0, the statusText is empty as is the responseText.
The include directory also contains the the Javascript file ACSCalcV3.0.js which is included via the HTML file ACSCalcV3.0.html via the code`` ```
Admittedly this is old code it has been in use since 2008 and other than a single file that should be updated annually has rarely been altered. The code is working fine on a PC at home (not accessible remotely any more) and has been working for years at www.flwg.com.au/guide/pg/cs_calculators since 2008.