HTTP Help
#1

Код 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;
	}
?>
I would want to know what am i doing wrong on both codes because PHP is sending syntax errors.. but i cant point out where cuz when you open it on a browser.. its giving no errors
Reply


Messages In This Thread
HTTP Help - by DeathKing - 13.06.2015, 04:24
Re: HTTP Help - by BroZeus - 13.06.2015, 06:54

Forum Jump:


Users browsing this thread: 1 Guest(s)