send_message_to_url returns ERROR as only string

Users who are viewing this thread

Code:
if (isset($_GET['type']) and isset($_GET["id"])) {
        //proper request should be -- 127.0.0.1/api.php?type=1&guid=guid&id=id&username=username
        if ($_GET['type'] == PLAYER_JOINED_EVENT) {
            if (!isRegistered($_GET["guid"])) {
                registerPlayer($_GET["guid"], $_GET["username"]);
                $id = $_GET["id"];
                echo "1|$id|0|0|0|0|";
            } else {
                $playerStats = getPlayerInfo($_GET["guid"]);
                $id = $_GET["id"];
                if ($row = $playerStats->fetch_assoc()) {
                    $guid = $row['guid'];
                    $kills = $row['kills'];
                    $deaths = $row['deaths'];
                    $money = $row['money'];
                    $rank = getPlayerRank($guid, "kills");
                    echo "1|$id|$guid|$kills|$deaths|$money|$rank|";
                }
            }
here's a short snippet of my code as player joins the server
called by lua script
Code:
local query = formatAPICall("api.php", {"type", "guid", "id", "username"}, {1, guid, player, game.sreg[44]})
    game.reg[45] = 100
    game.send_message_to_url(query)
(which is basically setting query to the url, setting reg45 to 100, and sending message to url query)
with query being http://127.0.0.1:8080/api.php?type=1&guid=1477436&id=5&username=Arthur (which is correct)
which returns the codes
Code:
1|5|1477436|10|2|10000|-1|
however, in the receive_url method, the number of strings is 1 and number of int is 0, with the only string being "ERROR"
does anyone have any idea how to fix this
I used phpmyadmin with sql and loosely followed the instructions in this thread https://forums.taleworlds.com/index.php?topic=299534.0
 
Top Bottom