Lectora-PHP form Submission

tkosker1029 Community Member Posts: 26

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


  • ssneg
    ssneg Community Member Posts: 1,466 ☆ Roadie ☆
    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.
  • tkosker1029
    tkosker1029 Community Member Posts: 26
    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
  • ssneg
    ssneg Community Member Posts: 1,466 ☆ Roadie ☆
    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?
  • tkosker1029
    tkosker1029 Community Member Posts: 26
    Hi Sergey,

    The php file is

    <?php mysql_connect("localhost", "uname", "upwd") or die("Connection Failed");
    mysql_select_db("dbname")or die("Connection Failed");
    $ema = $_GET['qmail'];
    echo $name;
    $query = "select * from Registrants where Email = '$ema'";
    $result = mysql_query($query);
    while ($line = mysql_fetch_array($result, MYSQL_ASSOC))
    echo $line['Name_and_Surname'];
    echo "<br>\n";

    Php file name is GetName.php and located under a subfolder of web root.

    And the lectora source has a form (GET function) and receive response enabled to a variable "Durum".

    Submission is working. But when I display the variable it returns as ~~~null~~~

    There is no way to have null value. The php works fine if you write url as http://www.......com/[email protected]. The browser returns correct value. But form submission returns null value.

  • tkosker1029
    tkosker1029 Community Member Posts: 26
    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

  • ssneg
    ssneg Community Member Posts: 1,466 ☆ Roadie ☆
    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.
Sign In or Register to comment.

So You Wanna Be An eLearning ROCKSTAR?

We're all fans of eLearning here! Want to become an eLearning ROCKSTAR? Just click on one of the buttons below to start your rocking journey!