Skip to Content

Welcome!

This community is for professionals and enthusiasts of our products and services.
Share and discuss the best content and new marketing ideas, build your professional profile and become a better marketer together.

This question has been flagged
As a moderator, you can either validate or reject this answer.
Accept Reject
43 Views

This is current alternative method, not a longer method

if u use

================================

$this->execPieceByName('ff_InitLib');


date_default_timezone_set('Asia/Kuala_Lumpur');


$name = ff_getSubmit('name');

$contact_no = ff_getSubmit('contact_no');

$email = ff_getSubmit('email');


$remarks = "Contact Form";

$remarks .= "\nMessage: ".ff_getSubmit('message');

======================================

but unable get the field value, u can try below method

=======================================

// Get the application object

$app = \Joomla\CMS\Factory::getApplication();


// Get the input object

$input = $app->input;


// Get submitted form data

$formData = $input->post->getArray();


// Extract individual field values from the array

$name = isset($formData['ff_nm_name'][0]) ? $formData['ff_nm_name'][0] : '';

$email = isset($formData['ff_nm_email'][0]) ? $formData['ff_nm_email'][0] : '';

$contact_no = isset($formData['ff_nm_contact_no'][0]) ? $formData['ff_nm_contact_no'][0] : '';

$message = isset($formData['ff_nm_message'][0]) ? $formData['ff_nm_message'][0] : '';


// Prepare remarks

$remarks = "Contact Form";

$remarks .= "\nName: " . $name;

$remarks .= "\nEmail: " . $email;

$remarks .= "\nContact No: " . $contact_no;

$remarks .= "\nMessage: " . $message;


but the fromData['name'], the name should according to ur form's name

Inspect to check the name of the field

Put [0] is ensure it can get the first one


Summary:

This is joomla get input function. If the system not support $this->execPieceByName('ff_InitLib'); method due to unknow reason, u can try this method first.

Avatar
Discard

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

Related Posts Replies Views Activity
0
Jul 24
81
1
Jan 24
79
1
Nov 23
76
1
Dec 23
81
1
Nov 23
68