Need a little help with a_http
#1

Hey guys just trying out the HTTP functions within the a_http include to check some information in a mysql database but for some reason it keeps returning an error code (6) wich doesn't exist as far as i know.

Note: i'm trying to get it to check the information via localhost.
pawn Код:
#include <a_samp>
#include <a_mysql>
#include <a_http>
#include <sscanf2>
#include <zcmd>

#define GAMEMODE_TEST ""

#define MYSQL_HOST ""
#define MYSQL_USER ""
#define MYSQL_DATA ""
#define MYSQL_PASS ""

#define URL_CHECK_WALLET "localhost/http_walletcheck.php"


//***************************************************************************************************

forward HttpResponse_WalletCheck(index, response_code, data[]);

//***************************************************************************************************

main()
{

}

public OnGameModeInit()
{
    print("test");
}

public HttpResponse_WalletCheck(index, response_code, data[])
{
    new playerid = index;
    if(response_code == 200)
    {
        if(strcmp(data,"true",true) == 0)
        {
            SendClientMessage(playerid, -1, "we completed your transaction...");
        } else {
            SendClientMessage(playerid, -1, "we could not complete your transaction, please try again.");
        }

    } else {

        new str[1048];
        format(str,sizeof(str), "An error occured when processing your transaction. (RESPONSE: %d)", response_code);
        SendClientMessage(playerid, -1, str);
    }
}

COMMAND:checkwallet(playerid, params[])
{
    new str[500];
    format(str,sizeof(str),"userid=%dwalletbalance=%d",1,1);
    HTTP(playerid, HTTP_POST, URL_CHECK_WALLET, str, "HttpResponse_WalletCheck");
    return 1;
}
Reply


Messages In This Thread
Need a little help with a_http - by zT KiNgKoNg - 14.12.2013, 12:11
Re: Need a little help with a_http - by zT KiNgKoNg - 15.12.2013, 07:22
Re: Need a little help with a_http - by zT KiNgKoNg - 16.12.2013, 11:44
Re: Need a little help with a_http - by zT KiNgKoNg - 17.12.2013, 08:20
Re: Need a little help with a_http - by zT KiNgKoNg - 18.12.2013, 19:20
Re: Need a little help with a_http - by CutX - 18.12.2013, 19:25
AW: Need a little help with a_http - by BigETI - 18.12.2013, 19:37
Re: Need a little help with a_http - by zT KiNgKoNg - 18.12.2013, 20:05
Re: Need a little help with a_http - by zT KiNgKoNg - 19.12.2013, 19:34
Re: Need a little help with a_http - by Kells - 19.12.2013, 19:43

Forum Jump:


Users browsing this thread: 1 Guest(s)