comparison php/test_write.php @ 2934:260efd43fe52

#228
author Nicholas Jillings <nicholas.jillings@mail.bcu.ac.uk>
date Mon, 11 Sep 2017 17:41:40 +0100
parents
children 53d701288da5
comparison
equal deleted inserted replaced
2933:95f507064bf2 2934:260efd43fe52
1 <?php
2 $file = "../saves/test-save.xml";
3 $state = file_put_contents($file, "<xml></xml>");
4 if ($state == FALSE) {
5 echo "<response state=\"error\"><message>Could not open file</message></response>";
6 } else {
7 unlink($file) or die("<response state=\"error\"><message>Could not open file</message></response>");
8 echo "<response state=\"OK\"><message>OK</message></response>";
9 }
10 ?>