view 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
line wrap: on
line source
<?php
$saveLocation = getSaveLocation();
$file = $saveLocation."test-save.xml";
$state = file_put_contents($file, "<xml></xml>");
if ($state == FALSE) {
    echo "<response state=\"error\"><message>Could not open file</message></response>";
} else {
    unlink($file) or die("<response state=\"error\"><message>Could not open file</message></response>");
    echo "<response state=\"OK\"><message>OK</message></response>";
}
?>