Save data submitted in a file

ilbuonsik

New Member
Good morning,
I need write a file using the data submitted in a form.
I insert this php script at the "End of form submission (onAfterProcess)":

PHP:
$Pratica = $formPratica->formData['Pratica'];
$Stato = JRequest::getVar('Stato');
$Timestamp = JRequest::getVar('date_time');
$myFile = "testFile.txt";
$fh = fopen($myFile, "a");
$stringData = ($Pratica . '\n' . $Stato . '\n' . $Timestamp);
fwrite($fh, $stringData);
fclose($fh);

I write this code reading other post, but i can't write the data! I write only "\n \n"
 
ok, found the right way. thanks a lot:

$Pratica = $formModel->formData['Pratica'];
$Stato = $formModel->formData['Stato'];
$Timestamp = $formModel->formData['date_time'];
$myFile = "tmp/testFile.txt";
$fh = fopen($myFile, "a");
$stringData = ($Pratica . "\n" . $Stato . "\n" . $Timestamp. "\n\n");
fwrite($fh, $stringData);
fclose($fh);
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top