finally a tuto that seems ok

This commit is contained in:
lenovo
2022-10-26 19:55:16 +02:00
parent c9e794b4ec
commit 40963ce3cb
7 changed files with 52 additions and 28 deletions

View 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");
}
?>