October 20, 2017
Using JavaScript, PHP and MySQL to Log Captivate Variable Data
Comments
(6)
October 20, 2017
Using JavaScript, PHP and MySQL to Log Captivate Variable Data
I create very technical E-Learning Courses teaching administration fundamentals for setting up Lenel and AMAG Alarm systems.    Our training courses teach administrators at the very corporate level in companies like Kaiser and Kilroy Realty.   I also create online meditation courses. 
Newbie 2 posts
Followers: 7 people
(6)

Many Captivate developers use a Learning Management System to log E-Learning Interactions.   The variable data in a Captivate project holds very useful information about how the user is progressing in your E-Learning Course.    Definitely Learning Management Systems are great and Adobe’s Prime LMS is excellent but what if you just want to log some simple user variable data and you don’t feel the need for a full LMS.   I am going to show you how to use JavaScript and PHP to capture Captivate variable data into MySQL tables.   Once the data is posted to the MySQL tables it can be reported on using PHP or a PHP Report Generator.

This instructional video will show you how to do this:

As shown in the instructional video the JavaScript $.post command passes the Captivate variables to the PHP program.   The PHP $_REQUEST command receives the Captivate variables into the PHP program where the data is processed and stored in the MySQL table where it can be reported on.

Example JavaScript:

$.post(‘http://mindarrive.com/phpcode/startdatetime2.php’,{vemail:ls_email, vstartdatetime:v_startdatetime, vtitleno:v_titleno, vincludeintro:v_includeintro, vcompanyid:ls_companyid}, function() {});

Example PHP:

<?php

$email = $_REQUEST[“vemail”];

$startdatetime = $_REQUEST[“vstartdatetime”];

$titleno =  $_REQUEST[“vtitleno”];

$includeintro= $_REQUEST[“vincludeintro”];

$companyid= $_REQUEST[“vcompanyid”];

$conn = new mysqli($servername, $username, $password, $dbname);

$sql = “INSERT INTO userlog (email, startdatetime, titleno,includeintro, durationtime) VALUES (‘$email’, ‘$startdatetime’, ‘$titleno’, ‘$includeintro’, 10)”;

$conn->close();

?>

Hope you find this implementation useful and it helps you with your Captivate course development.

Showcase Captivate Project:

Feel free the try out these relaxing Captivate Online Meditations at:

http://mindarrive.com/zenwithlen

Enjoy!

-Steve Lewis

6 Comments
2018-05-13 17:23:18
2018-05-13 17:23:18

hi, mr lewis, i need your help with something…

we are created a simulator for ms word, and we need save data with php and mysql, so we need to know if you can help us with this…

thanks,

jpolonia.

Like
2018-02-26 20:33:22
2018-02-26 20:33:22

Tried this code using a MSSQL connection but can’t seem to get it working…I am trying to send a variable from a textbox (tried to get the userid via system but it comes blank every time) and the user final score to an MSSQL server…

Like
2017-10-24 17:06:25
2017-10-24 17:06:25

In the session now! Great learning!

Like
2017-10-21 15:23:07
2017-10-21 15:23:07

Your sample project looks good on my Samsung S7.

Like
(1)
>
Paul Wilson
's comment
2017-10-21 16:53:53
2017-10-21 16:53:53
>
Paul Wilson
's comment

Thanks Paul, you taught me well. After your class I’ll really understand Fluid Boxes and the project will look even better!

Like
2017-10-21 04:37:38
2017-10-21 04:37:38

Excellent post Steve. Looking forward to seeing you in Vegas.

Like
Add Comment