Hirdetés
- Motorola Edge 50 Neo - az egyensúly gyengesége
- Samsung Galaxy S23 Ultra - non plus ultra
- Xiaomi 13 Pro - szerencsés szám
- iPhone topik
- Samsung Galaxy Z Flip5 - ami kint, az van bent
- Samsung Galaxy Watch (Tizen és Wear OS) ingyenes számlapok, kupon kódok
- Dupla kamerával menekülne az iPhone Air a kaszától
- Samsung Galaxy Z Fold7 - ezt vártuk, de…
- Samsung Galaxy S20 FE - tényleg nem lite
- Mobil flották
Ú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
- Filmvilág
- Kihúzhatja a gyufát a PC-s gyártóknál az érkező új Xbox
- Azonnali alaplapos kérdések órája
- Gyúrósok ide!
- Elon Musk billiomos lesz, ha kitör a gépek forradalma
- Sweet.tv - internetes TV
- Autóápolás, karbantartás, fényezés
- AMD Ryzen 9 / 7 / 5 9***(X) "Zen 5" (AM5)
- Battlefield 6
- Otthoni hálózat és internet megosztás
- További aktív témák...
- Eladó Lenovo LOQ laptop I5, Rtx2050, 16gb ram, 512 m2 ssd. Garancia.
- LG 55" 4K UHD AI Smart tv GARANCIÁVAL
- Bontatlan Google Pixel 10, 12GB ram 256GB rom frost/lila
- -ÚJ,2 ÉV GAR- DDR5 GAMER PC: RYZEN 7 8700F/9700X/9800X3D +RX 6600/6700XT +16-64GB DDR5! SZÁMLA!
- Samsung Galaxy Z Flip 7 12/512GB 2028.09.14-ig gari
- GYÖNYÖRŰ iPhone 12 mini 128GB Green -1 ÉV GARANCIA - Kártyafüggetlen, MS3395, 100% Akkumulátor
- HIBÁTLAN iPhone 13 mini 128GB Pink -1 ÉV GARANCIA -Kártyafüggetlen, MS3844, 100% Akkumulátor
- Dell Latitude 5320 - hibás kijelzők - i5 1135G7 ,16GB RAM, SSD, jó akku, számla
- HP EliteBook 840 G10 - 14"WUXGA - i7-1360P - 16GB - 512GB - Win11 - MAGYAR - 3 év garancia
- HIBÁTLAN iPhone 13 256GB Pink -1 ÉV GARANCIA - Kártyafüggetlen, MS3421
Állásajánlatok
Cég: Laptopműhely Bt.
Város: Budapest
Cég: NetGo.hu Kft.
Város: Gödöllő


