Hi, this kind of stuff is not working anymore, because it's not supported in PHP 8.*. How to fix?
add_action('frm_after_create_entry', 'create_csv', 30, 2);
function create_csv($entry_id, $form_id) {
if ($form_id == 2) { //replace 1234 with the id of the form
br
Markku
Not a lot to go on here…but maybe try
add_action('frm_after_create_entry', 'create_csv', 30, 2); function create_csv(int $entry_id, int $form_id): void { if ($form_id == 2) { // Your code for creating the CSV goes here } }
Are you trying to export from a view?
"int"'s didn't help. Exporting directly from the form.
I don't see anything in the snippet that should cause PHP 8+ to fail. Have you enabled WordPress debug to get a detailed error message?
It was after all: "ftp_put() expects parameter 1 to be resource, bool given in /home..."
Ok, this happens because ftp server is not online, but how to get something else than critical error/site down?
Tried this without luck:
if (($connect_it = ftp_connect($ftp_host)) !== false) {
$remote_file = $Client . "_" . $Project . "_" . $Product . "_" . $TimeStamp . ".csv";
if (ftp_put($connect_it, $remote_file, $local_file, FTP_BINARY)) {
//echo "WOOT! Successfully transfer $local_file\n";
} else {
echo "Doh! There was a problem, maybe server is offline...\n";
}
ftp_close($connect_it);
else { echo "noup";}
}
You're problem doesn't appear to have anything to do with Formidable. Formidable does not use ftp_put(). That looks like it may be custom code. You need to contact your server host to find out how to change your site's PHP error reporting.
Please login or Register to submit your answer
What is the error?
No closing braces?
Critical error, whole site goes down. Braces are there, this is just part of the code, but since PHP 8 has not create_function, I think this too relates to creating functions...PHP 7.4 ok, 8.0 no go.