Mercurial > hg > webaudioevaluationtool
changeset 600:0794fefefbd8
Minor corrections to PHP save script.
author | Nicholas Jillings <n.g.r.jillings@se14.qmul.ac.uk> |
---|---|
date | Thu, 10 Mar 2016 10:04:38 +0000 |
parents | d1d7b49fbeea |
children | 0df685136c89 |
files | save.php |
diffstat | 1 files changed, 4 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/save.php Thu Mar 10 10:38:31 2016 +0100 +++ b/save.php Thu Mar 10 10:04:38 2016 +0000 @@ -1,11 +1,5 @@ <?php error_reporting(0); - try{ - date_default_timezone_get(); - } - catch(Exception $e){ - date_default_timezone_set('UTC'); // Sets to UTC if not specified anywhere in .ini - } header('Access-Control-Allow-Origin: *'); header("Content-type: text/xml"); $postText = file_get_contents('php://input'); @@ -23,13 +17,13 @@ if ($wbytes === FALSE) { // FileWrite failed - $xml = '<response state="error"><message>Could not write file "saves/'.$xmlfile.'"</message></response>'; + $xml = '<response state="error"><message>Could not write file "'.$filename.'"</message></response>'; echo $xml; return; } fclose($fileHandle); - // Return JSON confirmation data - $xml = '<response state="OK"><message>OK</message><file bytes="'.$wbytes.'">"saves/'.$xmlfile.'"</file></response>'; + // Return XML confirmation data + $xml = '<response state="OK"><message>OK</message><file bytes="'.$wbytes.'">"'.$filename.'"</file></response>'; echo $xml; -?> +?> \ No newline at end of file