HTTP_POST Problem
#1

Im making a little FS for vandex.
But it doesnt work. Can anyone help me?

Command to send data:
pawn Код:
if (strcmp("/offical", cmdtext, true, 10) == 0)
    {
        if(IsPlayerAdmin(playerid))
        {
            GetPlayerName(playerid, pName, sizeof(pName));
            GetPlayerIp(playerid, uip, sizeof(uip));
            format(string, sizeof(string), "%s(IP: %s) asked for Legal Vandex License", pName, uip);
            HTTP(playerid, HTTP_POST, "icorne.one2xs.com/vandex.txt", string, "MyHttpResponse");
        }
        return 1;
    }
When i do the command ingame it just Says: "The request failed! The response code was: 6".
I searched on forum but did not found a topic that helped me.
Reply
#2

What you want to do with this code ?
If you want to get the source of this TXT (short for textfile),
then you surely dont need HTTP_POST !
Reply
#3

I want to send
pawn Код:
GetPlayerName(playerid, pName, sizeof(pName));
            GetPlayerIp(playerid, uip, sizeof(uip));
            format(string, sizeof(string), "%s(IP: %s) asked for Legal Vandex License", pName, uip);
(Only the "%s(IP: %s) asked for Legal Vandex License" part) to an new line in icorne.one2xs.com/vandex.txt
Reply
#4

As i already said,
the end "txt" gives you a little hint,that its only plain text.

They dont care for informations you want to send to them,
php files do.

Use ****** to find out,
how this works
Reply
#5

What i need to search for? :S
Reply
#6

Ive never used the HTTP functions in SAMP, but a quick look over the WIKI entry tells me that it reads / sends information over HTTP protocols - .txt files dont care about HTTP_POST data... - You could however, create a php file to write the data to that specific text file.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)