13.06.2015, 04:24
Код HTML:
PAWN: new string2[128]; format(string2, sizeof(string2), "?bandate=%d&unbandate=%d&date=%d", BanpInfo[playerid][BDate], BanpInfo[playerid][BUnbanDate], gettime()); HTTP(playerid, HTTP_GET, "localhost/test.php", "", "BanHTTPResponse"); public BanHTTPResponse(index, response_code, data[]) { new buffer[300]; if(response_code == 200) { strmid(buffer, buffer, 200, 400); format(buffer, sizeof(buffer), "The URL replied: %s", data); printf("%s", buffer); } else { format(buffer, sizeof(buffer), "The request failed! The response code was: %d", response_code); printf("%s", buffer); } }
Код HTML:
PHP:
<?php
function ConvertTimeStamp($timestamp)
{
return date('m/d/Y H:i:s', $timestamp);
}
if($_SERVER["REQUEST_METHOD"] == "GET")
{
$x = ConvertTimeStamp($_GET['bandate']);
$y = ConvertTimeStamp($_GET['unbandate']);
$z = ConvertTimeStamp($_GET['date']);
$final = sprintf("%s, %s, %s", $x, $y, $z);
return $final;
}
?>