comparison save.php @ 1886:49d06c3dc44e

Merge
author Nicholas Jillings <nickjillings@users.noreply.github.com>
date Wed, 09 Mar 2016 14:12:22 +0000
parents bf2a7da8d6ae b7db6a837242
children ba6b9e1aaef5
comparison
equal deleted inserted replaced
1302:34c168035394 1886:49d06c3dc44e
7 date_default_timezone_set('UTC'); // Sets to UTC if not specified anywhere in .ini 7 date_default_timezone_set('UTC'); // Sets to UTC if not specified anywhere in .ini
8 } 8 }
9 header('Access-Control-Allow-Origin: *'); 9 header('Access-Control-Allow-Origin: *');
10 header("Content-type: text/xml"); 10 header("Content-type: text/xml");
11 $postText = file_get_contents('php://input'); 11 $postText = file_get_contents('php://input');
12 $sha1_hash = sha1($postText); 12 $file_key = $_GET['key'];
13 $datetime = date('ymdHis'); 13 $filename = "saves/save-".$file_key.".xml";
14 $xmlfile = "save".$datetime."-".$sha1_hash.".xml"; 14 $fileHandle = fopen($filename, 'w');
15 $fileHandle = fopen("saves/".$xmlfile, 'w');
16 if ($fileHandle == FALSE) 15 if ($fileHandle == FALSE)
17 { 16 {
18 // Filehandle failed 17 // Filehandle failed
19 $xml = '<response state="error"><message>Could not open file</message></response>'; 18 $xml = '<response state="error"><message>Could not open file</message></response>';
20 echo $xml; 19 echo $xml;