view php/test_write.php @ 3049:aa86f045d338

Merge branch 'vnext' into Dev_main # Conflicts: # python/score_parser.py
author Nicholas Jillings <nicholas.jillings@mail.bcu.ac.uk>
date Tue, 17 Oct 2017 17:03:10 -0400
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>";
}
?>