aboutsummaryrefslogtreecommitdiffstats
path: root/craftmine.php
diff options
context:
space:
mode:
authoralexichi <alexbankai96@gmail.com>2016-04-20 12:16:30 +0200
committeralexichi <alexbankai96@gmail.com>2016-04-20 12:16:30 +0200
commit82e40e0ccc5ecb5c80de9fee44014fe7d8eb6cd0 (patch)
tree263dd2d8f95294e57d0fa83c0254a9e3ed070466 /craftmine.php
parent5143e83c176a9222d32f22b7c57287e00265dcbd (diff)
downloadcandybox-82e40e0ccc5ecb5c80de9fee44014fe7d8eb6cd0.tar.gz
candybox-82e40e0ccc5ecb5c80de9fee44014fe7d8eb6cd0.tar.bz2
candybox-82e40e0ccc5ecb5c80de9fee44014fe7d8eb6cd0.tar.xz
candybox-82e40e0ccc5ecb5c80de9fee44014fe7d8eb6cd0.zip
Add main PHP script
Diffstat (limited to 'craftmine.php')
-rw-r--r--craftmine.php29
1 files changed, 29 insertions, 0 deletions
diff --git a/craftmine.php b/craftmine.php
new file mode 100644
index 0000000..41f9580
--- /dev/null
+++ b/craftmine.php
@@ -0,0 +1,29 @@
+<?php
+session_start();
+
+/**
+* Indique au client une message requete.
+*/
+function reportBadRequest() {
+ header("HTTP/1.1 400 Bad Request");
+ echo "Format de la requete incorrect.";
+ echo "Il est attendu une requete de type POST avec 2 parametres:";
+ echo "<ul>";
+ echo "<li><b>op</b>: l'operation a executer ('inc', 'dec')</li>";
+ echo "<li><b>pos</b>: la position du hero dans la liste</li>";
+ echo "</ul>";
+ echo "<br/>";
+ echo "La requete aura ete executee avec succes lorsque la page retournera un code 200";
+ echo "<br/>Parametres POST recu: ";
+ var_dump($_POST);
+ echo "<br/>Parametres GET recu: ";
+ var_dump($_GET);
+ exit();
+}
+if (!isset($_POST["op"])) {
+ reportBadRequest();
+}
+
+
+
+?>