|
@@ -4,6 +4,7 @@
|
|
|
// This PHP must be used if you intend to register in MySQL server the students interactions.
|
|
|
// Adjust the names here and those in your MySQL server.
|
|
|
//
|
|
|
+// The following files make reference to the table fields (must use the same names "line_id, line_name, ...")
|
|
|
// @see js/globals.js
|
|
|
// @see js/circleOne.js
|
|
|
// @see js/squareOne.js
|
|
@@ -13,7 +14,7 @@
|
|
|
$servername = "localhost"; // INSERT MySQL name (e.g "line.ime.usp.br")
|
|
|
$username = "put_username"; // INSERT MySQL user name
|
|
|
$password = "put_password"; // INSERT MySQL password
|
|
|
-$dbname = "db_ifractions"; // INSERT database name (default="db_ifractions")
|
|
|
+$dbname = "db_ifractions"; // INSERT database name (default="db_ifractions")
|
|
|
|
|
|
$tablename = "ifractions"; // INSERT table name (default="ifractions")
|
|
|
|
|
@@ -48,30 +49,30 @@ if ($conn->connect_error) {
|
|
|
|
|
|
$ip = clientIP();
|
|
|
|
|
|
-// /js/globals.js: data = s_ip=120.0.0.1&s_name=name&s_lang=pt_BR
|
|
|
-// /js/squareOne.js: data += &s_game=Square&s_mode=A&s_oper=Plus&s_leve=1&s_posi=1&s_resu=true&s_time=3&s_deta=numBlocks:3, valBlocks: 1,1,1, blockIndex: 2, floorIndex: 2;url=php/save.php
|
|
|
-$name = $_REQUEST["s_name"];
|
|
|
+// /js/globals.js: data = line_ip=120.0.0.1&line_name=name&line_lang=pt_BR
|
|
|
+// /js/squareOne.js: data += &line_game=Square&line_mode=A&line_oper=Plus&line_leve=1&line_posi=1&line_resu=true&line_time=3&line_deta=numBlocks:3, valBlocks: 1,1,1, blockIndex: 2, floorIndex: 2;url=php/save.php
|
|
|
+$name = $_REQUEST["line_name"];
|
|
|
$date = date("Y-m-d H:i:s");
|
|
|
-$lang = $_REQUEST["s_lang"];
|
|
|
-$game = $_REQUEST["s_game"];
|
|
|
-$mode = $_REQUEST["s_mode"];
|
|
|
-$oper = $_REQUEST["s_oper"];
|
|
|
-$leve = $_REQUEST["s_leve"];
|
|
|
-$posi = $_REQUEST["s_posi"];
|
|
|
-$resu = $_REQUEST["s_resu"];
|
|
|
-$time = $_REQUEST["s_time"];
|
|
|
-$deta = $_REQUEST["s_deta"];
|
|
|
+$lang = $_REQUEST["line_lang"];
|
|
|
+$game = $_REQUEST["line_game"];
|
|
|
+$mode = $_REQUEST["line_mode"];
|
|
|
+$oper = $_REQUEST["line_oper"];
|
|
|
+$leve = $_REQUEST["line_leve"];
|
|
|
+$posi = $_REQUEST["line_posi"];
|
|
|
+$resu = $_REQUEST["line_resu"];
|
|
|
+$time = $_REQUEST["line_time"];
|
|
|
+$deta = $_REQUEST["line_deta"];
|
|
|
|
|
|
$nameUnchanged = $name; // /js/preMenu.js: playerName
|
|
|
|
|
|
-$name = remove_accents($name);
|
|
|
+$name = remove_accents($name);
|
|
|
|
|
|
if (is_object($lang))
|
|
|
$lang = json_decode($lang);
|
|
|
|
|
|
-// Table 'ifractions': id s_hostip s_playername s_datetime s_lang s_game s_mode s_operator s_level s_mappos s_result s_time s_details
|
|
|
+// Table 'ifractions': line_id line_hostip line_playername line_datetime line_lang line_game line_mode line_operator line_level line_mappos line_result line_time line_details
|
|
|
$sql = "INSERT INTO $tablename
|
|
|
-(s_hostip, s_playername, s_datetime, s_lang, s_game, s_mode, s_operator, s_level, s_mappos, s_result, s_time, s_details)
|
|
|
+(line_hostip, line_playername, line_datetime, line_lang, line_game, line_mode, line_operator, line_level, line_mappos, line_result, line_time, line_details)
|
|
|
VALUES
|
|
|
('$ip', '$name', '$date', '$lang', '$game', '$mode', '$oper', $leve, $posi, '$resu', $time, '$deta')";
|
|
|
|
|
@@ -79,7 +80,7 @@ VALUES
|
|
|
if ($conn->query($sql) === TRUE) {
|
|
|
print "Saved.";
|
|
|
$result = "OK";
|
|
|
- }
|
|
|
+ }
|
|
|
else {
|
|
|
print "Error: " . $sql . "<br>" . $conn->error;
|
|
|
$result = "Error: " . $conn->error;
|
|
@@ -93,4 +94,4 @@ fclose($fp);
|
|
|
|
|
|
$conn->close();
|
|
|
|
|
|
-?>
|
|
|
+?>
|