I have this script below and its working good. It works when I load the .php file directly even with external javascript tags.
index.html
<div id="content"></div>
<script src="//code.jquery.com/jquery-1.11.3.min.js"></script>
<script src="test.js"></script>
test.js
$(document).ready(function() {
$('#content').load('content/index.php')
});
/content/index.php
<?php
require_once("geoip.inc");
$gi = geoip_open("GeoIP.dat", GEOIP_STANDARD);
$country_code = geoip_country_code_by_addr($gi, $_SERVER['REMOTE_ADDR']);
geoip_close($gi);
if ($country_code == 'RO' ||
$country_code == 'DO' ||
$country_code == 'PK' ||
$country_code == 'MA' ||
$country_code == 'PE' ||
$country_code == 'IR' ||
$country_code == 'DZ' ||
$country_code == 'RU' ||
$country_code == 'EG') {
echo 'country not supported';
} else {
echo 'supported';
}
?>
My Question is:
When I am trying to
echo 'supported';
It is working good.
But when I tried to echo
<SCRIPT SRC="http://externalsite.com/ads/sample.js" TYPE="text/javascript"></SCRIPT>
the script tag wasn't show. I need to load the .php file inside my .js file