SA-MP Forums Archive
http problem - 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)
+--- Thread: http problem (/showthread.php?tid=387833)



http problem - Snir_sofer - 26.10.2012

PHP код:
new WebList[][80]=
{
    {
"http://website.com/index.php"// this not really web
};
stock QueryIP(pid,IpAddress[],Time)
{
    new 
szstr[150];
    for(new 
ww<sizeof(WebList); w++)
    {
        
format(szstr,sizeof(szstr),"%s?act=get&host=%s&time=%d",WebList[w],IpAddress,Time);
        
HTTP(pidHTTP_POST,szstr,"","MygetipResponse");
    }
}
forward MygetipResponse(response_code,data[]);
public 
MygetipResponse(response_code,data[])
{
    if(
response_code == 200)printf("Content : %s",data);
    else 
printf("Failure ! Reason = %d",response_code);
    return 
1;

this return:
Failure ! Reason = 4


why?


Re: http problem - gtakillerIV - 26.10.2012

See this:

https://sampwiki.blast.hk/wiki/HTTP

Quote:

HTTP_ERROR_CANT_WRITE 4 <-----Error code 4.




Re: http problem - Snir_sofer - 26.10.2012

write to....?


Re: http problem - gtakillerIV - 26.10.2012

You used HTTP_POST and you were trying to post this:

format(szstr,sizeof(szstr),"%s?act=get&host=%s&tim e=%d",WebList[w],IpAddress,Time);


HTTP(pid, HTTP_POST,szstr,"","MygetipResponse");

Not sure but you might have to enter a password to post in your php file.


Re: http problem - Snir_sofer - 26.10.2012

I want to enter the server address you specified array


Re: http problem - Snir_sofer - 26.10.2012

///?