is there any php code example that i can refer to display video content based on country? i want to display certain video for china's users
You can get the IP address of the client as below if(!empty($_SERVER['HTTP_CLIENT_IP'])){ $ip = $_SERVER['HTTP_CLIENT_IP'];} elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])){ $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];}else{ $ip = $_SERVER['REMOTE_ADDR'];} Then using api like http://www.hostip.info/use.html you can get the country name/country code and on the basis of that you can show the video content Other Free api are http://ipinfodb.com/ip_location_api.php http://www.ipgeo.com/api/ http://ip2.cc/ http://www.geobytes.com/IpLocator.htm
Other Alternative is 1) Get the IP address of client 2) download ip-tables (http://dev.maxmind.com/geoip/legacy/geolite/) 3) Check with your requirement and display the video