Welcome to Chiangmai and Chiangrai magazine
Site Map
'; echo $fdata['filedata']; //======================================================= // Set common curl options function set_common_curl_options($curlresource) { curl_setopt ($curlresource, CURLOPT_HEADER, 0); curl_setopt ($curlresource, CURLOPT_RETURNTRANSFER, true); curl_setopt ($curlresource, CURLOPT_FOLLOWLOCATION, true); curl_setopt ($curlresource, CURLOPT_FRESH_CONNECT, true); curl_setopt ($curlresource, CURLOPT_HTTP_GET, true); curl_setopt ($curlresource, CURLOPT_CONNECTTIMEOUT, 20); curl_setopt ($curlresource, CURLOPT_TIMEOUT, 80); curl_setopt ($curlresource, CURLOPT_COOKIESESSION, true); curl_setopt ($curlresource, RLOPT_USERAGENT,"Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: Gecko/20090824 Firefox/3.5.3"); } //======================================================= // Fetch on URL function fetch_url($url) { # applog("encoded URL: $url"); $cret = array(); // Now do it for real on the URL $curl = curl_init ($url); set_common_curl_options($curl); curl_setopt ($curl, CURLOPT_COOKIEFILE, $COOKIEJAR); $cret['filedata'] = curl_exec ($curl); $cret['status'] = curl_error($curl); // curl operations complete curl_close($curl); return ($cret); } ?>

Home | Site Map | Sponsors | Feedback | Hot Links | Travel Help | Search

Copyright © 1995-2014 Welcome to Chiangmai and Chiangrai magazine All rights reserved.
Web site design and hosting by Infothai CM Co. Ltd.