comparison php/keygen.php @ 2510:8536e978ab6f

Work for #158
author Nicholas Jillings <nicholas.jillings@mail.bcu.ac.uk>
date Mon, 24 Oct 2016 10:39:20 +0100
parents d26623bd65e0
children 177cbd750610
comparison
equal deleted inserted replaced
2508:9b536838a962 2510:8536e978ab6f
24 return; 24 return;
25 } 25 }
26 } 26 }
27 } 27 }
28 } 28 }
29 echo $xml_good; 29 $filename = "saves/save-".$key_requested.".xml";
30 $fileHandle = fopen($filename, 'w');
31 if ($fileHandle == FALSE) {
32 echo $xml_error;
33 }
34 fclose($fileHandle);
30 // TODO: 35 // TODO:
31 // Generate the XML Base file and save it 36 // Generate the XML Base file and save it
32 $doc_struct = new SimpleXMLElement('<waetresult/>'); 37 $doc_struct = new SimpleXMLElement('<waetresult/>');
33 $doc_struct->addAttribute("key",$key_requested); 38 $doc_struct->addAttribute("key",$key_requested);
34 // Add start time 39 // Add start time
35 // Add IP Address information 40 // Add IP Address information
36 // Save the file 41 // Save the file
37 $doc_struct->asXML("saves/save-".$key_requested.".xml"); 42 $doc_struct->asXML($filename);
43 echo $xml_good;
38 return; 44 return;
39 } else { 45 } else {
40 echo $xml_error; 46 echo $xml_error;
41 return; 47 return;
42 } 48 }