view php/test_write.php @ 2962:292c0bd8d87d

Merge pull request #259 from othiman/master fix bug introduced in 6e05fd48809259342e69b3cdd942bf458edd4c53
author Nick Jillings <nickjillings@users.noreply.github.com>
date Tue, 09 Jan 2018 16:09:23 +0000
parents 260efd43fe52
children 53d701288da5
line wrap: on
line source
<?php
$file = "../saves/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>";
}
?>