view php/test_write.php @ 3135:afc32cd44b22

Merge pull request #288 from jpcima/work Fix a typo in description text
author Nick Jillings <nickjillings@users.noreply.github.com>
date Mon, 11 Mar 2019 11:41:14 +0000
parents c7de85e03321
children
line wrap: on
line source
<?php
include_once("config.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>";
}
?>