HTTP and PHP
#1

Hey. My question is simple. How do I return data to SA-MP Script from PHP Page.

PAWN Code
pawn Код:
HTTP(playerid,HTTP_POST,"mg-s.us/country.php",string,"GetPlayerCountry");
PHP Part (country.php)
PHP код:
<?
    $ip 
$_POST['ip'];
    
$country geoip_country_name_by_name($ip);
?>
Now I want to know how do declare what has to be sent back to SA-MP Server?
Reply
#2

https://sampwiki.blast.hk/wiki/HTTP
Reply
#3

PHP код:
echo $country
Then use data in your HTTP callback.
Reply
#4

@InfiniTy. Still you didn't help. I'm asking for PHP Part of code which sends data back to server. It clearly isn't stated there.

@Vince So just to echo it? Thanks.
Reply
#5

Quote:
Originally Posted by [MG]Dimi
Посмотреть сообщение
@InfiniTy. Still you didn't help. I'm asking for PHP Part of code which sends data back to server. It clearly isn't stated there.

@Vince So just to echo it? Thanks.
Didn't seem like you have the callback in your pawn code..

So i thought that you need the data in your samp server and stuff, sorry
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)