sockets does not send data to php file
plugin code:
PHP Code:
#include <amxmodx>
#include <sockets>
new HOST[] = "127.0.0.1";
new FILE[] = "test.php";
new Server[64];
new nick[33][32], ip[33][23], sid[33][35];
new socket, error;
public plugin_cfg() {
get_cvar_string("hostname", Server, 63);
socket = socket_open(HOST, 80, 1, error);
}
public client_putinserver(id) {
get_user_name(id, nick[id], 31);
get_user_ip(id, ip[id], 22, 1);
get_user_authid(id, sid[id], 34);
set_task(2.0, "test", id+101);
}
public test(id) {
id -= 101;
new sData[256];
format(sData, 255, "GET /%s?name=%s&authid=%s&ip=%s&server=%s HTTP/1.0^r^n", FILE, nick[id], sid[id], ip[id], Server);
format(sData, 255, "%sHost: %s^r^n^r^n", sData, HOST);
socket_send(socket, sData, strlen(sData));
}
php file:
PHP Code:
<?php
$link = mysqli_connect(host, user, pass, db);
$name = $_GET['name'];
$authid = $_GET['authid'];
$ip = $_GET['ip'];
$server = $_GET['server'];
mysqli_query($link, "INSERT `sockets_test` (name, authid, ip, server) VALUES ('$name', '$authid', '$ip', '$server')");
?>
when go in from the www is a query to the mysql database be execute
where is the mistake in the plugin?