HTTP Problem
#1

PHP код:
forward UpdateMap(playeridresponse_codedata[]);
public 
UpdateMap(playeridresponse_codedata[])
{
    new
        
string1028 ];
    if(
response_code == 200)
    {
        
format(stringsizeof(string), "%s"data);
        
printf("%s"string);
    }
    else
    {
        
format(stringsizeof(string), "The request failed! The response code was: %d"response_code);
        
SendClientMessage(playerid0xFFFFFFFFstring);
    }
}
public 
OnPlayerCommandText(playeridcmdtext[]){
    if(!
strcmp(cmdtext"/load")){
        
HTTP(playeridHTTP_GET"http://akibkhan.byethost7.com/maps.txt""""UpdateMap");
        
SendClientMessage(playerid, -1"CMD Sent!");
        return 
1;
    }
    return 
1;

It returns Bad Host error, but host is correct
PHP код:
http://akibkhan.byethost7.com/maps.txt 
Reply
#2

how many times do you want to format your string?

pawn Код:
format(string, sizeof(string), "%s", data);
printf("%s", string);
Loading this URL causes a redirect, which is not response code "200".
Reply
#3

Quote:
Originally Posted by BigETI
Посмотреть сообщение
how many times do you want to format your string?

pawn Код:
format(string, sizeof(string), "%s", data);
printf("%s", string);
Loading this URL causes a redirect, which is not response code "200".
Thanks for your reply, i want to show all data at once.

I fixed it, just don't use http(s)://www.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)