1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
<?php
if(isset($_POST['login']) && isset($_POST['score'])) {
header("Content-Type: text/xml");
header("Expires: Mon, 12 Jul 1995 02:00:00 GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
$fp = fopen('donnees.xml', 'w');
$xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n";
$xml .= "<jeu>\r\n";
$xml .= "\t<best>\r\n";
$xml .= "\t\t<login><![CDATA[".$_POST['login']."]]></login>\r\n";
$xml .= "\t\t<score>".$_POST['login']."</score>\r\n";
$xml .= "\t</best>\r\n";
$xml .= '</jeu>';
if(@fwrite($fp, $xml)) {
$reponse = "<reponse>OK</reponse>";
} else {
$reponse = "<reponse>ERREUR</reponse>";
}
fclose($fp);
print $reponse;
}
?> |
Partager