Hirdetés
- droidic: Safe Mode az agyban
- Luck Dragon: Asszociációs játék. :)
- Rap, Hip-hop 90'
- D1Rect: Nagy "hülyétkapokazapróktól" topik
- sziku69: Szólánc.
- sziku69: Fűzzük össze a szavakat :)
- Sub-ZeRo: Euro Truck Simulator 2 & American Truck Simulator 1 (esetleg 2 majd, ha lesz) :)
- djculture: Éhezők ssd és memória viadala.
- eBay-es kütyük kis pénzért
- DeFranco: Tanuljunk angolul játékosan! - Duolingo
Ú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
- Épített vízhűtés (nem kompakt) topic
- iPhone topik
- Amit látnod kell 80’ – 90’ évek, egész estét betöltő mozi filmjei.
- Canon MILC: EOS R és M topik
- OLED TV topic
- Mit tud egy nagy név? Teszten az Acer Predator Orion 5000 PC
- Synology NAS
- ThinkPad (NEM IdeaPad)
- A foltozásra fókuszált az új GeForce driver
- AMD K6-III, és minden ami RETRO - Oldschool tuning
- További aktív témák...
- PS4 FAT (1216A 12.02 GOLDHEN)
- FÉLÁRON SZINTE ÚJ HP HyperX Cloud Stinger Bolti ár:25k INGYEN FOXPOST
- Bomba ár! Fujitsu Lifebook T936: i5-6G I 8GB I 256SSD I 13,3" FHD Touch I Cam I W10 I Gari!
- Bomba ár! HP ProBook 640 G2 - i3-6GEN I 4GB I 128GB SSD I 14" FHD I Cam I W11 I Garancia!
- több db DELL P2417 full HD 1920x1080 IPS monitor HDMI - gari + számla
Állásajánlatok
Cég: Laptopszaki Kft.
Város: Budapest
Cég: ATW Internet Kft.
Város: Budapest

