Using the external PHP script with the Reporting Widget

If you wish to use the external PHP script this is the procedure to follow.

Script location:

If possible, I recommend that you upload the PHP script files to a fixed location on your web server. This makes it easy to work with whenever you want to deploy a new course.

Example: You own the domain In this case, you can create a directory/folder on your web server called “script” and upload the PHP files to this location. The PHP files would then be located on HTTP(s):// Whenever you deploy a course, you can use this URL directly in the widget properties to make it connect to the PHP script.

Alternatively, if you do not wish to follow this approach, you can manually add the PHP files to your course package when you have published it. This will need to be done every time you republish the course though.

In that case, add the four (4) PHP files directly in the root folder of your published course as seen below.

Finally, upload your course to a web server.

Using SMTP mail server:

If you wish to use your own SMTP mail server to send the emails, you need to manually add your SMTP server information in the PHP files.

Open up sendData.php with Notepad or similar, and add your SMTP server information in the file. Save the file again and re-upload it. If you are publishing to Flash based output (SWF) you will need to make the same edits to the file sendDataFlash.php.


The PHP script uses the very popular and well supported PHPMailer framework to send emails. If you are having difficulties with getting this to work with your SMTP server, you may need to resort to Google to help you. Some hosting providers have imposed their own rules and security and thus need specific setup in order for them to work.

InMotion hosting has a specific guide on PHPMailer and SMTP emails here.

If you are using GoDaddy as your hosting provider, you should read the PHPMailer troubleshooting guide here.


Using the PHP Script in your Learning Management System (LMS)

With 99% certainty, you will not be able to use any type of external script in your LMS (unless it is Moodle) as vendors typically lock down this functionality. You can try and contact your LMS vendor and ask them about this, but alternatively, you can follow the guide below to set up crossdomain requests.


Hosting the PHP script on one domain and hosting courses on another domain

If you are using the custom script location and host the PHP files on and your course files are located on a different domain like, this will not work due to the same-origin policy imposed on Flash and JavaScript. Scripts residing on one domain are not allowed to communicate with scripts on a different domain, without explicit permission.

If you are deploying to Flash/SWF from Adobe Captivate, you will need to define a crossdomain policy. This is done by uploading a crossdomain.xml file directly to the root of your web server. Ookla has a nice guide here on how to create a crossdomain.xml file.

If you are deploying to HTML5 you will need to enable Cross-Origin Resource Sharing (CORS) on your server. This is way more complicated than the crossdomain.xml solution for Flash based output, so I recommend that you use as a resource to find out how to do this. You can also read through this great Using CORS tutorial on HTML5Rocks.



in Reporting Widget