12.10.2013, 10:10
Hello,
I am trying to fix a ******* searcher with results but its giving me error Error: Request failed! Try again later. [Response code: 1] ( BAD HOST)
The php file is in my public_html folder at my host and the file have 644 rights.
Is there any way to fix this?
Admigo
I am trying to fix a ******* searcher with results but its giving me error Error: Request failed! Try again later. [Response code: 1] ( BAD HOST)
pawn Код:
CMD:*******(playerid, params[])
{
if(sscanf(params, "s[128]", params))
{
SendClientMessage(playerid, COLOR_BLUE, "Usage: /******* < Name of video to search >");
SendClientMessage(playerid, COLOR_ORANGE, "Function: It will search and reproduce the specified ******* song.");
return 1;
}
Request_Type[playerid] = 0;
if(strcmp(params, Last_Search[playerid], true))
{
format(Last_Search[playerid], 128, "%s", params);
new assist[256];
format(assist, sizeof(assist), "http://admigos.net/curl.php?limit="#MAX_RESULTS"&linkid=http://www.*******.com/results?search_query=%s", params);
for(new i = 35; i < strlen(assist); i++) if(assist[i] == ' ') assist[i] = '?';
HTTP(playerid, HTTP_GET, assist, "", "My*******HttpResponse");
return 1;
}
ShowResultsWindow(playerid);
return 1;
}
forward My*******HttpResponse(index, response_code, data[]);
public My*******HttpResponse(index, response_code, data[])
{
if(response_code == 200)
{
new assist[128];
new f = strfind(data, ">", true, 0), t = 0, offset = 0;
while(f != -1 && t < MAX_RESULTS)
{
strmid(assist, data, f + 1, f + 12);
//by Nightmare[TR] (https://sampforum.blast.hk/showthread.php?tid=370450) - You can change this address to your own website host:
format(Results_Links[index][t], 128, "http://element-samp.net/*******.php?videoid=%s", assist);
strmid(assist, data, f + 15, strfind(data, "<", true, f + 15));
format(Results_Names[index][t], 128, "%s", assist);
t++;
offset = f + 16;
f = strfind(data, ">", true, offset);
}
Videos_Found[index] = t;
ShowResultsWindow(index);
}
else
{
format(Dialog_String, sizeof(Dialog_String), "Error: Request failed! Try again later. [Response code: %d]", response_code);
SendClientMessage(index, COLOR_RED, Dialog_String);
}
return 1;
}
Is there any way to fix this?
Admigo