diff --git a/_function.php b/_function.php new file mode 100644 index 0000000..fe74acb --- /dev/null +++ b/_function.php @@ -0,0 +1,40 @@ + true, + CURLOPT_URL => $url, + CURLOPT_TIMEOUT => 10, + CURLOPT_CONNECTTIMEOUT => 5, + CURLOPT_SSL_VERIFYPEER => FALSE, + CURLOPT_HEADER => $headershow, + CURLOPT_USERAGENT => $this->httph + ); + curl_setopt_array($ch, $opts); + if ($otherheader) curl_setopt($ch, CURLOPT_HTTPHEADER, $otherheader); + if ($cookie) curl_setopt($ch, CURLOPT_COOKIE, $cookie); + if ($postparam) + { + curl_setopt($ch, CURLOPT_POST, 1); + curl_setopt($ch, CURLOPT_POSTFIELDS, $postparam); + } + + $data = curl_exec($ch); + curl_close($ch); + if ($curl_errno > 0) + $this->ErrorEcho(14, 'Connect Error!!!'); + return ($data) ? $data : false; + } + } \ No newline at end of file