The $_POST
array structure is determined by the name
attribute of each field which exists inside of the <form></form>
tags.
All of the basics are here: https://docs.joomla.org/Retrieving_request_data_using_JInput
The array
option is appropriate when you have brace-syntax in the field's name to express a nested structure on the field's submission data. example
Although Joomla does have getArray()
, I recommend that you systematically grab the field values individually and include the default value and sanitisation technique when accessing the data.
From docs: $input->post->get(param_name, default_value, filter);
In practice:
$emailTask = $input->post->get('emailtask', '', 'CMD');
$emailTask$formId = $input->post->get('formid', '', 'WORD');
$emailTask$emailAuthor = $input->post->get('emailauthor', '', 'RAW'); // because stripping tags can potentially damage fringe case email addresses; use additional sanitisation step before using this value
$emailTask$itemId = $input->post->get('itemid', '', 'INT');
$emailTask$itemTitle = $input->post->get('itemtitle', '', 'STRING');
$emailTask$itemAlias = $input->post->get('itemalias', '', 'STRING');
$emailTask$itemAuthor = $input->post->get('itemauthor', '', 'STRING');
$emailTask$catId = $input->post->get('catid', '', 'INT');
$emailTask$return = $input->post->get('return', '', 'RAW');
If your expected post data isn't even making it to the destination where you expect it, then your issue is not in receiving the data, but sending it to the right place.
I don't know what is rendered by:
'.$titleformD.'
'.$fields_display.'
'.$consent_field.'
'.$captcha_html.'
so I don't know know if there is <form></form>
inside of your form tags.