WorldAds2™ Geo-targeted Ad Management file_get_content issue - Joomla! Forum - community, help and support


hi tried install module worldads2 , got warning file_get_contents() function:

warning: file_get_contents() [function.file-get-contents]: url file-access disabled in server configuration in /homepages/.../modules/mod_worldads2/tmpl/default.php on line 5

warning: file_get_contents(http://api.hostip.info/country.php?ip=86.206.232.37) [function.file-get-contents]: failed open stream: no suitable wrapper found in /homepages/.../modules/mod_worldads2/tmpl/default.php on line 5

here how solved issue:
replace following line in ../mod_worldads2/tmpl/default.php :
$country = file_get_contents('http://api.hostip.info/country.php?ip='.$ip);
by this:
----
$url = "http://api.hostip.info/country.php?ip=$ip";
//initialize curl session
$ch = curl_init();

//set curl return data instead of printing browser.
curl_setopt($ch, curlopt_returntransfer, 1);
//set url
curl_setopt($ch, curlopt_url, $url);
//execute fetch
$string = curl_exec($ch);
//close connection
curl_close($ch);

//$string contains contents of $url

$country == $string;






Comments

Popular posts from this blog

How to decompile jsxbin to jsx

Gavik Photoslide GK2: Not able to upload photos - Joomla! Forum - community, help and support

Phoca Guestbook logger registret bruger af - Joomla! Forum - community, help and support