HTTP (Tutorial)?
#10

Сам запрос:
pawn Code:
format(query, sizeof(query), "user=%s", GetPlayerName(playerid));
HTTP(playerid, HTTP_POST, "varlando.ru/mail.php", query, "HttpResponse");
mail.php
PHP Code:
define('SERVER_IP'127.0.0.1);
if(
$_SERVER['REMOTE_ADDR'] != SERVER_IP) die('Hacking attempt');
// здесь сам mail()
echo 'Successfully sent to '.$_POST['user']; 
Обработка ответа:
pawn Code:
public HttpResponse(index, response_code, data[])
{
    if(IsPlayerConnected(index) && index != INVALID_PLAYER_ID && response_code == 200) SendClientMessage(index, 0xFFFFFF00, data);
    else printf("Error in response data");
}

На работоспособность не проверял
Reply


Messages In This Thread
HTTP (Tutorial)? - by Johnny_Xayc - 25.08.2010, 10:55
Re: HTTP (Tutorial)? - by Romanius - 25.08.2010, 14:19
Re: HTTP (Tutorial)? - by Winston - 25.08.2010, 15:34
Re: HTTP (Tutorial)? - by Johnny_Xayc - 25.08.2010, 15:39
Re: HTTP (Tutorial)? - by Winston - 25.08.2010, 16:12
Re: HTTP (Tutorial)? - by Johnny_Xayc - 25.08.2010, 16:37
Re: HTTP (Tutorial)? - by Johnny_Xayc - 25.08.2010, 17:09
Re: HTTP (Tutorial)? - by Winston - 25.08.2010, 17:14
Re: HTTP (Tutorial)? - by Johnny_Xayc - 25.08.2010, 17:59
Re: HTTP (Tutorial)? - by Walk_M4n - 29.08.2010, 09:39

Forum Jump:


Users browsing this thread: 2 Guest(s)