Hello,
I would like to have some registers of a Chronoform added into a qr code and saved in a database when the submit button is pressed. I have found this entry:
https://www.chronoengine.com/faqs/70-cfv5/5271-creating-a-qr-code-from-form-data.html
I have not tried it yet because I have no idea of how get it saved into the database. Is there a simple way to get it to work?
Thanks in advance
Hi jsole125,
There isn't enough information here to say anything much except that there is a permissions problem somewhere. Have you any idea where in the code this message is generated? If you enable site Debugging you might see some more useful messages.
Do you have FTP enabled on the site? That can sometimes give rise to permissions problems?
Bob
Hi Bob,
I decided start again. I made a Chronoform which is properly working. DB saving is ok.
Now I know it is better to save the qr code in a folder and to save the name and location to the DB. So that is what I want achieve.
Should I use the script in this page in order to save name and location?
https://www.chronoengine.com/faqs/70-cfv5/5271-creating-a-%3Cspan
Or should I use other?
Thanks
Hi jsole125,
I suggest that you try that one.
Bob
Hi Bob,
Thank you for your advice.
It has come to my mind that I already have an image which is saved in a folder and name and location in the DB. Could this be the problem?
Thanks
Hi jsole125,
Sorry, there is no way I can tell if that is the problem . . . I don't even know what the problem is :-(
Bob
Hi Bob,
// this line sets the content of the qr code
$text = $form->data['text1'];
I have changed "text1" for the "field name" of the design item that I want to get it in the qr code. Is that right?
Josep
H Josep,
Yes, that's correct.
Bob
Hello again Bob,
As the rest of the script (previous message) I think it is ok, I paste it in a On Submit event from Basic Custom Code. When I click on save I get the following error message:
Forbidden
You do not have permission to access this document.
Permissions:
phpqrcode.php 644
uploads/qrcodes/ 755
Where could be the error?
PS This instance of Joomla has not enabled the FTP layer.
Josep
Hi Josep,
Please take a Form Backup using the icon in the Forms Manager and post it here (as a zipped file) or PM or email it to me and I'll take a closer look on my test server.
I suspect that this is a server permissions problem - you may need to check with your web host.
Bob
Hello Bob,
Here you are. The specific form is called "entrallavors".
I could not put the script into the custom code item because of the error. So I have attached an other php file with the script as I put it in the event box.
Thanks again
Hi Bob,
No success. I have got the same error.
I have even changed this:
$folder = JPATH_SITE.'/components/com_chronoforms5/uploads/qrcodes/';
into the absolute path to my site:
/httpdocs/components/com_chronoforms5/uploads/qrcodes
with no luck.
Images work either absolute path or the one I had before.
What looks strange to me is that while images can be upload with no problems on permissions, qr codes can not.
Thanks
Josep
Hi Josep,
By all means PM me the site URL, the form name, and a SuperAdmin login and I'll take a quick look. I'm not sure that I'll find anything though, this may need your web host to take a look.
Bob
Hi Josep,
Please check with your web host - as far as I can see there is some security setting in your site that prevents you saving PHP from form actions.
Bob
Hi Bob,
I have been in contact with my web host service and they told me, as you have said, that it is a question of security. As it is a shared web hosting, "the injection of code in database is not allowed" in order not to compromise server security (?).
Puzzled. Any workaround?
Thank you
Josep
Hi Josep,
That would explain it; I'm afraid that the only suggestion that I have is to change your web host :-(
Bob