Mercurial > hg > webaudioevaluationtool
annotate php/test_write.php @ 3120:53d701288da5
Create new php config to allow saves to be stored outside of web scope
author | Nicholas Jillings <nicholas.jillings@mail.bcu.ac.uk> |
---|---|
date | Wed, 18 Jul 2018 16:47:07 +0100 |
parents | 260efd43fe52 |
children | 3e97bf9d24cf |
rev | line source |
---|---|
nicholas@2934 | 1 <?php |
nicholas@3120 | 2 $saveLocation = getSaveLocation(); |
nicholas@3120 | 3 $file = $saveLocation."test-save.xml"; |
nicholas@2934 | 4 $state = file_put_contents($file, "<xml></xml>"); |
nicholas@2934 | 5 if ($state == FALSE) { |
nicholas@2934 | 6 echo "<response state=\"error\"><message>Could not open file</message></response>"; |
nicholas@2934 | 7 } else { |
nicholas@2934 | 8 unlink($file) or die("<response state=\"error\"><message>Could not open file</message></response>"); |
nicholas@2934 | 9 echo "<response state=\"OK\"><message>OK</message></response>"; |
nicholas@2934 | 10 } |
nicholas@2934 | 11 ?> |