Jump to content

PHP Data saves from IE but not from Mozilla


lau

Recommended Posts

sorry the code that actually saves the data is on the last page it is:

 


<?php
   $File = "Results.txt";
$Handle = fopen($File, 'a');
   foreach ($_POST as $key => $val) {
   //fwrite ($Handle, $val);
fwrite ( $Handle, $val. "," );

}
fclose($Handle);
  ?>

Can you post the code that creates the forms?

 

Also, I think, it would be much cleaner to save the information in a SESSION.

 

At the top of each processing script, put:

<?php
session_start();
?>

 

The instead of the code that generates the hidden input fields, do:

<?php
foreach ($_POST as $key => $val)
   if ($key != 'submit') // or whatever your submit button is named
      $_SESSION['hidden'][$key] = $val;
?>

 

In the last script where you save the information:

<?php
foreach ($_POST as $key => $val)
   if ($key != 'submit') // or whatever your submit button is named
      $_SESSION['hidden'][$key] = $val;
$File = "Results.txt";
$Handle = fopen($File, 'a');
fwrite($Handle, implode(',',$_SESSION['hidden'] . "\r\n"); //this way you don't have a trailing comma after all the values
fclose($Handle);
?>

 

Ken

 

If HTML works in one browser and not another, it is likely that the HTML markup is invalid and one browser ignores the invalid HTML while the other browser does not.

 

Copy and paste the "view source" of your 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.