Hirdetés
- sziku69: Szólánc.
- Luck Dragon: Asszociációs játék. :)
- sziku69: Fűzzük össze a szavakat :)
- Real Racing 3 - Freemium csoda
- droidic: Windows 11 önállóság nélküli világ: a kontroll új korszaka
- Gurulunk, WAZE?!
- D1Rect: Nagy "hülyétkapokazapróktól" topik
- Brogyi: CTEK akkumulátor töltő és másolatai
- Sub-ZeRo: Euro Truck Simulator 2 & American Truck Simulator 1 (esetleg 2 majd, ha lesz) :)
- kraftxld: Diáklaptop - Dell Latitude 3140 - Királyunk ajándéka
Új hozzászólás Aktív témák
-
Sk8erPeter
nagyúr
válasz
Lacces
#10560
üzenetére
Azért nem működik, mert be kell tenned még ezt:
// This will make cURL follow the redirects (@see http://stackoverflow.com/questions/6028050/curl-returntransfer-is-empty-curl-getinfo-error-1)
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);Tehát a teljes függvény:
/**
* Download a website or any other file using cURL
*
* @see http://www.jonasjohn.de/snippets/php/curl-example.htm
* @see http://stackoverflow.com/questions/6028050/curl-returntransfer-is-empty-curl-getinfo-error-1
*
* @param string $Url
* @return string
*/
function curl_download($Url){
// is cURL installed yet?
if (!function_exists('curl_init')){
die('Sorry cURL is not installed!');
}
// OK cool - then let's create a new cURL resource handle
$ch = curl_init();
// Now set some options (most are optional)
// Set URL to download
curl_setopt($ch, CURLOPT_URL, $Url);
// This will make cURL follow the redirects (@see http://stackoverflow.com/questions/6028050/curl-returntransfer-is-empty-curl-getinfo-error-1)
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
// Set a referer
curl_setopt($ch, CURLOPT_REFERER, "http://www.example.org/yay.htm");
// User agent
curl_setopt($ch, CURLOPT_USERAGENT, "MozillaXYZ/1.0");
// Include header in result? (0 = yes, 1 = no)
curl_setopt($ch, CURLOPT_HEADER, 0);
// Should cURL return or print out the data? (true = return, false = print)
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
// Timeout in seconds
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
// Download the given URL, and return output
$output = curl_exec($ch);
// Close the cURL resource, and free system resources
curl_close($ch);
return $output;
}Teszt:
$curl_download = curl_download('http://www.example.org/');
echo $curl_download;
Új hozzászólás Aktív témák
- Milyen asztali (teljes vagy fél-) gépet vegyek?
- sziku69: Szólánc.
- Battlefield 6
- Telekom otthoni szolgáltatások (TV, internet, telefon)
- Folyószámla, bankszámla, bankváltás, külföldi kártyahasználat
- Linux Mint
- Milyen házat vegyek?
- Milyen CPU léghűtést vegyek?
- AMD Ryzen 9 / 7 / 5 9***(X) "Zen 5" (AM5)
- Luck Dragon: Asszociációs játék. :)
- További aktív témák...
- Fujifilm 33/1.4 R LM WR
- Crucial P310 1TB M.2 2230 NVME PCI-E 4.0 x4 - Új, bontatlan - 7100-6000 MBs - Eladó!
- Használt NVME M2 SSD-k - 1000 GB tól 2048GB-ig Samsung Hynix Intel Kioxia WD Micron Toshiba
- WD Black SN770M 2TB M.2 2230 NVME PCI-E 4.0 x4 - Új - 5150-4850 MBs - Eladó!
- Gamer PC 2025, Komplett gép, Garanciális alkatrészek, BESZÁMÍTÁS
- ÁRGARANCIA!Épített KomPhone Ryzen 7 7800X3D 32/64GB RAM RX 9070 16GB GAMER PC termékbeszámítással
- HIBÁTLAN iPhone 13 Pro 128GB Graphite -1 ÉV GARANCIA - Kártyafüggetlen, MS3747, 91% Akkumulátor
- LG 32GS95UX - 32" OLED / UHD 4K / 240Hz - 480Hz & 0.03ms / 1300 Nits / NVIDIA G-Sync / AMD FreeSync
- Alkalmi ár! Gamer Notebook! Acer Nitro 15 - I7 11800H / RTX 3060 / 16GB DDR4 / 512 SSD + 1TB HDD
- AKCIÓ!!! RITKASÁG! Microsoft Surface Pro 11 Qualcomm Snapdragon X Elite 16GB 512GB OLED 120Hz Gar!
Állásajánlatok
Cég: Promenade Publishing House Kft.
Város: Budapest
Cég: PCMENTOR SZERVIZ KFT.
Város: Budapest

