Mercurial > hg > webaudioevaluationtool
comparison php/requestKey.php @ 2940:8805556c0f42
Potential fix for #235
author | Nicholas Jillings <nicholas.jillings@mail.bcu.ac.uk> |
---|---|
date | Thu, 14 Sep 2017 13:10:51 +0100 |
parents | 1ba5ac9d88e7 |
children | 9a201c63a0eb |
comparison
equal
deleted
inserted
replaced
2939:5d7e33fd00d8 | 2940:8805556c0f42 |
---|---|
15 header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0"); | 15 header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0"); |
16 header("Cache-Control: post-check=0, pre-check=0", false); | 16 header("Cache-Control: post-check=0, pre-check=0", false); |
17 header("Pragma: no-cache"); | 17 header("Pragma: no-cache"); |
18 | 18 |
19 // Get the current test URL | 19 // Get the current test URL |
20 // Load up the parameters | |
21 $saveFilenamePrefix = ''; | |
22 if (isset($_GET['saveFilenamePrefix'])) { | |
23 $saveFilenamePrefix = $_GET['saveFilenamePrefix'].'-'; | |
24 } else { | |
25 $saveFilenamePrefix = "save-"; | |
26 } | |
20 $testURL = ""; | 27 $testURL = ""; |
21 if (isset($_GET['url'])) { | 28 if (isset($_GET['url'])) { |
22 $testURL = "../".$_GET["url"]; | 29 $testURL = "../".$_GET["url"]; |
23 } | 30 } |
24 | 31 |
45 if ($unique) { | 52 if ($unique) { |
46 $key = $tempKey; | 53 $key = $tempKey; |
47 } | 54 } |
48 } | 55 } |
49 | 56 |
50 $filename = "../saves/save-".$key.".xml"; | 57 $filename = "../saves/".$saveFilenamePrefix.$key.".xml"; |
51 $fileHandle = fopen($filename, 'w'); | 58 $fileHandle = fopen($filename, 'w'); |
52 if ($fileHandle == FALSE) { | 59 if ($fileHandle == FALSE) { |
53 die("<response><state>ERROR</state><key>".$key."</key><message>Could not open file for writing</message></response>"); | 60 die("<response><state>ERROR</state><key>".$key."</key><message>Could not open file for writing</message></response>"); |
54 } | 61 } |
55 fclose($fileHandle); | 62 fclose($fileHandle); |