ontarget
Active Member
Hi I have just upgraded a fabrik 3.1system to php8.1
Similar to https://fabrikar.com/forums/index.php?threads/form-email-plugin-doesnt-send-mails-in-php8.53466/
I have a php form plugin set to onAfterProcess In Both on New
After submitting the form its supposed to execute the following php ( generating a shortened url using yourls API)
However nothing happens - it just submits and the php is not being executed
Is this a known issue?
Thanks
Here is the code in the php form plugin.
Similar to https://fabrikar.com/forums/index.php?threads/form-email-plugin-doesnt-send-mails-in-php8.53466/
I have a php form plugin set to onAfterProcess In Both on New
After submitting the form its supposed to execute the following php ( generating a shortened url using yourls API)
However nothing happens - it just submits and the php is not being executed
Is this a known issue?
Thanks
Here is the code in the php form plugin.
PHP:
$username = 'xxxxxxx';
$password = 'xxxxxxx';
$url= 'https://xxxxxxx.ie/index.php?option=com_fabrik&view=form&formid=1' .
'&aaa_participant_claim___uniqueclaim_id='. urlencode('{___course_id}') .
'&aaa_participant_claim___category=' . urlencode('{___category_raw}') .
'&aaa_participant_claim___course_title=' . urlencode('{___course_title}') .
'&aaa_participant_claim___course_code=' . urlencode('{___enter_course_code}') .
'&aaa_participant_claim___applysess=' . urlencode('{___apply_sess}') .
'&aaa_participant_claim___allow_overnight=' . urlencode('{___allow_overnight}') .
'&aaa_participant_claim___venue=' . urlencode('{___calcvenuename}').
'&aaa_participant_claim___course_start_date=' . urlencode('{___enter_course_date}') .
'&aaa_participant_claim___course_hours=' . urlencode('{___course_hours}') .
'&aaa_participant_claim___tutor_preparation_hours=' . urlencode('{___tutor_preparation_hours}') .
'&aaa_participant_claim___course_during_school=' . urlencode('{___course_during_school}') .
'&aaa_participant_claim___claim_process=' . urlencode('{___edcentre_email}') .
'&aaa_participant_claim___edcentre_id=' . urlencode('{___edcentreid}') .
'&aaa_participant_claim___edcentre_process=' . urlencode('{___education_centre}').
'&aaa_participant_claim___venue_ec=' . urlencode('{___calcvenueeircode}');
$title = '{___education_centre}'; // optional, if omitted YOURLS will lookup title with an HTTP request
$format = 'simple'; // output format: 'json', 'xml' or 'simple'
// EDIT THIS: the URL of the API file
$api_url = 'https://xxxx.ie/links/yourls-api.php';
// Init the CURL session
$ch = curl_init();
curl_setopt( $ch, CURLOPT_URL, $api_url );
curl_setopt( $ch, CURLOPT_HEADER, 0 ); // No header in the result
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true ); // Return, do not echo result
curl_setopt( $ch, CURLOPT_POST, 1 ); // This is a POST request
curl_setopt( $ch, CURLOPT_POSTFIELDS, array( // Data to POST
'url' => $url,
'keyword' => $keyword,
'title' => $title,
'format' => $format,
'action' => 'shorturl',
'username' => $username,
'password' => $password
) );
// Fetch and return content
$data = curl_exec($ch);
curl_close($ch);
// Do something with the result. Here, we just echo it.
$myapp = JFactory::getApplication();
$myapp->enqueueMessage("<p>Here is your shortened URL: </p>
<p>Please make a copy of this link and give it to your users</p><hr>
<h2 style='color:red;'>$data</h2>
<hr>
<p><a class ='uk-button uk-button-primary' href='$data' target='_blank'>Test the SHORT Link</a></p>
");
return $data;