SA-MP Forums Archive
HTTP post help? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: HTTP post help? (/showthread.php?tid=169532)



HTTP post help? - Fj0rtizFredde - 19.08.2010

Hey all
I need some help with the HTTP_POST function. My question is how do I post a variable to it? Like this:
pawn Код:
new Testing = 5;
HTTP(playerid, HTTP_POST, "localhost/test/test.php", "test=WHAT????", "MyHttpResponse");
I have tried to put test=Testing and it did not work. I have also tried to do a format and send that but it did not work Anyone knows the problem?


Re: HTTP post help? - Fj0rtizFredde - 20.08.2010

Bump (12 hours) Anyone know's how to do this?


Re: HTTP post help? - vital2k - 20.08.2010

Edit: My bad i read it wrong

pawn Код:
new Testing = 5;
    new string[128];
    format(string, sizeof(string), "?test=%i", Testing);
    HTTP(playerid, HTTP_POST, "localhost/test/test.php", string, "MyHttpResponse");
Doesn't work?


Re: HTTP post help? - Fj0rtizFredde - 20.08.2010

Thanks got it to work now


Re: HTTP post help? - VIRUXE - 29.08.2010

How did you get it to work?


AW: Re: HTTP post help? - n4pkill - 27.03.2011

Quote:
Originally Posted by ViRuXe
Посмотреть сообщение
How did you get it to work?
exactly^^

i wann aknow that too... because i have a similar problem:
everytime i am calling a php file i get a BAD_HOST (response_code 1) error...

what i shall do?

ЂdiT: i found out why the error came its because of "http://" the url should NOT include this tag should look like "******.com"