finally a tuto that seems ok
This commit is contained in:
23
srcs/plugins/google_map/get_url.php
Normal file
23
srcs/plugins/google_map/get_url.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
function get_url( $url ) {
|
||||
if ( in_array('curl', get_loaded_extensions()) ) {
|
||||
$args = curl_init();
|
||||
|
||||
curl_setopt($args, CURLOPT_AUTOREFERER, TRUE);
|
||||
curl_setopt($args, CURLOPT_HEADER, 0);
|
||||
curl_setopt($args, CURLOPT_RETURNTRANSFER, 1);
|
||||
curl_setopt($args, CURLOPT_REFERER, site_url());
|
||||
curl_setopt($args, CURLOPT_URL, $url);
|
||||
curl_setopt($args, CURLOPT_FOLLOWLOCATION, TRUE);
|
||||
|
||||
$data = curl_exec($args);
|
||||
curl_close($args);
|
||||
|
||||
return $data;
|
||||
}
|
||||
else
|
||||
console_log("curl is not installed");
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user