background music Any expert in xibo can figure out this

Asked by pj

In xibo client we setup xampp to handle php code. on
/opt/lampp/htdocs/sound/enable.php

<?php
$file = fopen("test.txt","w");
echo fwrite($file,"1");
fclose($file);
?>
This PHP code open our existing file test.txt and write 1 into it.

/opt/lampp/htdocs/sound/disable.php

<?php
$file = fopen("test.txt","w");
echo fwrite($file,"0");
fclose($file);
?>
This PHP code open our existing file test.txt and write 0 into it.

From server we used 2 layout for this testing. on layout1 we add 1 region with webpages link=http://localhost/sound/enable.php and on layout2 we add 1 region with webpages link=http://localhost/sound/disable.php.
What we want to accomplish is when xibo client running displaying layout1 the file /opt/lampp/htdocs/sound/test.txt should have 1 into it and then when displaying layout2 test.txt should have 0 into it.
 Observation: the code is running and writed 1 to test.txt when current display is layout1,
then if change to layout2 write 0, when it go back to layout1 the test.txt not change is remain to 0, meaning it run only once. what possible reason why this happen supposed test.txt should change sequence to write 1 if layout1 0 if layout2 and again. . . . so I can call my shell script when 1 run script for audio background if 0 then disable audio background.

thanks

Question information

Language:
English Edit question
Status:
Answered
For:
Xibo Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
kobus44 (kobus44) said :
#1

Maybe this has something to do with the browser chaching the first instance of the php script running, and then not re-running it for a second time, due to it being cached in its local memory. I would suggest to first make sure you incorporate no-cache headers in your pages.

Revision history for this message
pj (puye) said :
#2

how to incorporate no-cache headers pages did you have any Idea.

thanks

Revision history for this message
kobus44 (kobus44) said :
#3

Can you help with this problem?

Provide an answer of your own, or ask pj for more information if necessary.

To post a message you must log in.