เขียน curl เบื้องต้น

เริ่มโดย EThaiZone, 25 มีนาคม 2007, 12:55:38

หัวข้อก่อนหน้า - หัวข้อถัดไป

0 สมาชิก และ 1 ผู้มาเยือน กำลังดูหัวข้อนี้

EThaiZone

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, 'url เว็บที่อยากเรียกครับ');
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$data = curl_exec($ch);
curl_close($ch);


จะได้ $data ออกมาครับ

[email protected]

ตามอ่านไม่ไหว เยอะจัด  :D

EThaiZone

มาแปะไว้สำหรับคนใช้ dreamhost ครับ
เพราะพวกคำสั่ง fopen file_get_contents ใช้งานไม่ได้

และนี้เขียนให้รันได้บน php4ได้ + ตัด header ทิ้ง