Raised This Month: $ Target: $400
 0% 

Sockets does not send data to php file


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
OnePL
BANNED
Join Date: May 2012
Location: GB
Old 05-19-2014 , 12:39   Sockets does not send data to php file
Reply With Quote #1

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 
socketerror;

public 
plugin_cfg() {
    
get_cvar_string("hostname"Server63);
    
socket socket_open(HOST801error);
}

public 
client_putinserver(id) {
    
get_user_name(idnick[id], 31);
    
get_user_ip(idip[id], 221);
    
get_user_authid(idsid[id], 34);

    
set_task(2.0"test"id+101);
}

public 
test(id) {
    
id -= 101;

    new 
sData[256];
    
format(sData255"GET /%s?name=%s&authid=%s&ip=%s&server=%s HTTP/1.0^r^n"FILEnick[id], sid[id], ip[id], Server);
    
format(sData255"%sHost: %s^r^n^r^n"sDataHOST);
    
socket_send(socketsDatastrlen(sData));

php file:
PHP Code:
<?php
    $link 
mysqli_connect(hostuserpassdb);

    
$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?
OnePL is offline
Send a message via ICQ to OnePL Send a message via AIM to OnePL Send a message via Yahoo to OnePL Send a message via Skype™ to OnePL
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 09:39.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode