Lectora-PHP form Submission
September 6, 2015 12:00 AM
Hello,
I have a lectora content and I want some data to be stored on web MYSQL DB. The data is inserted by a php file. Lectora uses form submission to connect to php file.
The problem is it works fine in source code. When I publish and ftp to website, the values are returned as null and its not working. I assume it is some kind of a permission problem but whatever I have tried could not solve it.
I will appreciate any help. Thanks in advance
Discussion (8)
Dear Sergey
The values are ok. And the source files are working fine. Either the debug mode returns the values. The problem is when the source files are published to website.
When run in website the values are null and it has never a chance to receive null value. It seems like it can2t reach the php file folder. But the file folder permissions are all set to 777.
Really confused
So, which one isn't working?
1. Does the POST request Lectora makes contain correct values? Check with Network tab in browser console.
2. Does the PHP file receive correct values? Check with smth like "echo $_POST["your_variable_here"]"
3. Do these values get written to the database? Check in the database.
Hello Sergey, Hello everyone,
Finally I found the problem. During the submission it is important that you use www at the beginning. If you don't use www in url you will not get any response from your PHP.
I use chrome I haven't tried on other browsers.
Whoever lives the same problem please try to add www in your first link to your website before trying anything else. I spent around a week in this problem. And also the lectora technicians couldn't help me on this.
Kind regards
undefined
The values of what are null? Lectora variable values or the values in the POST request?
Also, can you give access to all of it in some form so that I could poke around?
This must be linked to how the particular server is setup, so without looking into the server confit, it wouldn't be possible to pinpoint, I guess.
I am trying to solve this exact same issue, however, my php URL does not use "www" as a prefix. Does anyone on this string know the solution to how this works?
thanks in advance!
I am trying to solve this exact same issue, however, my php URL does not use "www" as a prefix. Does anyone on this string know the solution to how this works?
The prefix shouldn't matter, as long as you use the correct URL (defined as the URL that your [Apache?] server recognizes, the one that triggers the PHP script.