comparison save.php @ 371:ad267c5e32ae

Merge of dev into default/master
author Nicholas Jillings <n.g.r.jillings@se14.qmul.ac.uk>
date Fri, 04 Dec 2015 11:00:55 +0000
parents 9823ee8c823e
children a95d323a911e
comparison
equal deleted inserted replaced
370:58fdadeb1414 371:ad267c5e32ae
1 <?php 1 <?php
2 header('Access-Control-Allow-Origin: *'); 2 header('Access-Control-Allow-Origin: *');
3 header("Content-type: text/xml"); 3 header("Content-type: text/xml");
4 $postText = file_get_contents('php://input'); 4 $postText = file_get_contents('php://input');
5 $sha1_hash = sha1($postText);
5 $datetime = date('ymdHis'); 6 $datetime = date('ymdHis');
6 $xmlfile = "save".$datetime.".xml"; 7 $xmlfile = "save".$datetime."-".$sha1_hash.".xml";
7 $fileHandle = fopen("saves/".$xmlfile, 'w'); 8 $fileHandle = fopen("saves/".$xmlfile, 'w');
8 if ($fileHandle == FALSE) 9 if ($fileHandle == FALSE)
9 { 10 {
10 // Filehandle failed 11 // Filehandle failed
11 $xml = '<response state="error"><message>Could not open file</message></response>'; 12 $xml = '<response state="error"><message>Could not open file</message></response>';