Tag Archives: curl

[note] curly braces และ เพื่อนๆ

From the top: square brackets, curly brackets (braces), parentheses, angle brackets, and (in red) inequality signs   จาก http://en.wikipedia.org/wiki/Braces_%28punctuation%29#Braces Related Blogs Behind the Video: Alicia Keys – 'Un-thinkable (I'm Ready)'Explaining Inequality Trends: Pretty Simple? | Progressive FixIt's IMG next – … Continue reading

[code] อัพโหลดภาพเข้า twitpic โดยใช้ api

[code] อัพโหลดภาพเข้า twitpic โดยใช้ api จะใช้ CURL ซึ่ง จาก function จะ input username ,password , filepath function postTwitpic($username='',$password='',$filepath='') { $postfields = array(); $postfields['username'] = $username; $postfields['password'] = $password; $postfields['media'] = "@$filepath"; $twitter_url = 'http://twitpic.com/api/upload'; $curl = curl_init(); curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 2); … Continue reading

getPage และ postPage ด้วย php+cURL

มีฟังก์ชั่น 2 อัน ชื่อตรงตัวเลยครับว่าให้ทำอะไร วิธีใช้ก็อ่านเอาที่ Prototype ของ function ได้เลยครับ //———————————————————————————– function getPage($url, $referer, $timeout, $header){ if(!isset($timeout)) $timeout=30; $curl = curl_init(); if(strstr($referer,”://”)){ curl_setopt ($curl, CURLOPT_REFERER, $referer); } curl_setopt ($curl, CURLOPT_URL, $url); curl_setopt ($curl, CURLOPT_TIMEOUT, $timeout); curl_setopt ($curl, CURLOPT_USERAGENT, sprintf(“Mozilla/%d.0″,rand(4,5))); curl_setopt ($curl, … Continue reading