Its a simple javascript-php scenario works in all browsers except in Firefox.
<script type=”text/javascript”>
loadPage(“test.php”,”Home.php”,”NONE”,”NONE”);
function loadPage(actionClass,screenInfo,parameters,applyMsg) {
β var form = document.createElement(‘Form’);
β form.setAttribute(‘method’,’POST’);
β actionClass = screenInfo ;
β form.setAttribute(‘action’,actionClass);
β screenInfoElement = document.createElement(“INPUT”);
β screenInfoElement.setAttribute(“type”,”hidden”);
β screenInfoElement.setAttribute(“id”,”LOAD_PAGE”);
β screenInfoElement.setAttribute(“name”,”LOAD_PAGE”);
β screenInfoElement.setAttribute(“value”,screenInfo);
β form.appendChild(screenInfoElement);
β parametersInfoElement = document.createElement(“INPUT”);
β parametersInfoElement.setAttribute(“type”,”hidden”);
β parametersInfoElement.setAttribute(“id”,”parameters”);
β parametersInfoElement.setAttribute(“name”,”parameters”);
β parametersInfoElement.setAttribute(“value”,parameters);
β form.appendChild(parametersInfoElement);
β applyMsgElement = document.createElement(“INPUT”);
β applyMsgElement.setAttribute(“type”,”hidden”);
β applyMsgElement.setAttribute(“id”,”APPLY_MSG”);
β applyMsgElement.setAttribute(“name”,”APPLY_MSG”);
β applyMsgElement.setAttribute(“value”,applyMsg);
β form.appendChild(applyMsgElement);
β alert(“LOAD Page Called from Pagemap.cs 2″ +screenInfo +”,actionClass : “+actionClass+”, ApplyMSG : “+ applyMsg +”, parameters : ” +parameters);
β document.body.appendChild(form);
β form.submit();
}
</script>
I could the see values being populated in the Alert box.
Now the handler in php, this method is in test.php
<?php
…..
$fileAccessArray = array(“allow”,”deny”,”val3″,”val4″);
isFileAccessValid($fileAccessArray);
…..
function isFileAccessValid($fileAccessArray)
{
// writeToLog(“******** FroM SessionManagementUtils.php –> isFileAccessValid() **“);
$page = false;
$pg = “NO PAGE SELECTED”;
echo nl2br(“n POST ARRAY From SessMgmt Page “);
writeToLog(“ FroM SessionManagementUtils.php –> $pg = **********”. $pg.”, POST “.implode(‘,’, $_POST) .”, GET “.implode(‘,’, $_GET) );
β if(isset($_POST[‘LOAD_PAGE’]) ) {
ββif (in_array( $_POST[‘LOAD_PAGE’], $fileAccessArray)){
βββ $page = true;
βββ $pg =$_POST[‘LOAD_PAGE’];
ββ }
β } else if(isset($_GET[‘LOAD_PAGE’]) ) {
ββ if (in_array( $_GET[‘LOAD_PAGE’], $fileAccessArray)){
βββ $page = true;
βββ $pg =$_GET[‘LOAD_PAGE’];
ββ } else {
βββ killBackEndSession();
βββ destroyCurrentSession();
βββ $url =”login.php” ;
βββ header(“Location: $url?error=invalidFileRequested”);
ββ }
β}
return $page ;
}
?>
Content printed in the log file
[04-Feb-xxxxxxx] ******** FroM SessionManagementUtils.php –> $pg = **********NO PAGE SELECTED, POST , GET
[04-Feb-xxxxxxx]
Logfile shows there is no filename $pg = **********NO PAGE SELECTED,
However when called elsewhere it prints the values properly.
[04-Feb-xxxxxxx] ******** FroM SessionManagementUtils.php –> $pg = **********NO PAGE SELECTED, POST test.phpNONENONE, GET
This issue is also only in fire fox.
Any help is much appreciated.