HTTP post help?
#1

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?
Reply
#2

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

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?
Reply
#4

Thanks got it to work now
Reply
#5

How did you get it to work?
Reply
#6

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"
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)