PHP and StoryLine.

Oct 15, 2015

Hi,

I recently started working with StoryLine as part of my job as a developer. There was a need for 'storage' of some user input variables which would be loaded/saved/edited throughout various courses. For a couple of days I investigated passing variables to and from StoryLine and saving them via various methods including WebStorage and at one point using PHP on a pop out window to save them in session storage and then retrieve them via JS in SL (though this is where the limitation occurred as although I can iterate through webstorage to check the number of key/value pairs - you cannot dynamically create variables in StoryLine).

I thought there would be a much easier way to achieve this and I found it.

There is a method to embed php directly in to your storyline slides. All it takes is a simple 'dummy' HTML file with a redirect to a PHP page. Since the WebObject loads in an iFrame, there is no limit/error in this method.

I create a file named 'index.html' in a folder and in this same folder I place my php file. When the webObject loads in StoryLine it redirects to the 'login.php' file. This also allows you to insert the WebObject in to a StoryLine slide as a 'marker' for where the PHP will load/show results.

Hope this helps someone. I have checked on the discussion groups and haven't found anything related, so sorry if this topic has been covered previously.

Thanks,

Kris

-----------------------

Here is the PHP page showing in storyline :

Here is the simple redirect script :

<!DOCTYPE HTML>
<head>
<meta charset="UTF-8">
<meta http-equiv="refresh" content="1;url=login.php">
<script type="text/javascript">
window.location.href = "login.php"
</script>
<title>Page Redirection</title>
</head>
<body>
If you are not redirected automatically, follow the <a href='login.php'>link</a>
</body>
</html
11 Replies
Kris Burns

You are welcome Michael, it was a simple solution to a complex issue. The box with the blue outline you can see in the image is a storyline shape, then there is a webobject on top of it, which is where the PHP redirect is. I have a PHP login system which then allows users to add/update/delete words from their 'bank'.  :) If you have any questions when you get to using it, give me a shout :)

This discussion is closed. You can start a new discussion or contact Articulate Support.