ChronoEngine.com homepage

Forums

Please write a review for the extension you are using on the Joomla extensions directory before posting a new question as we are being spammed by many negative reviews.

Thank you for your support!

Qr code on CV6

currucutaco 20 Oct, 2017
Hi I have a doubt, There is the possibility of using the phpqrcode library to insert a code qr in my form?

I have used this on Chronoforms v5 but not in Chronoforms v6 the code is not generated
-This is the code that I use (before I download the phpqrcode library from web and insert the file phpqrcode.php in the folder)

<?php
// get the QR Code library
include (JPATH_SITE.'/components/com_chronoforms6/extras/phpqrcode/phpqrcode.php');

// this line sets the content of the qr code
$text = $form->data['folio'];

$folder = JPATH_SITE.'/components/com_chronoforms6/uploads/qrcodes/';
$url = JURI::root().'components/com_chronoforms6/uploads/qrcodes/';

// create the file name
$file_name = 'qr_'.date('Ymd-his').'.png';

// create the QR code
QRcode::png($text, $folder.$file_name);

// save the name to the $form->data array
$form->data['qr_code'] = $file_name;

// add the file info to the $form->files array
$form->files['qr_code'] = array(
'name' => $file_name,
'link' => $url.$file_name,
'path' => $folder.$file_name,
'size' => filesize($folder.$file_name)
);

// display the code
echo "<div><img src='{$url}{$file_name}' /></div>";
?>
GreyHead 21 Oct, 2017
Hi currucutaco,

CFv6 has a different way of handling PHP variables - it does not use $form->data (and maybe not $form->files). Please check the manual for the way to create dynamic values like this.

Bob
This topic is locked and no more replies can be posted.

2Checkout.com

2CheckOut.com Inc. (Ohio, USA) is an authorized retailer for goods and services provided by ChronoEngine.com