Update webpagetool.php

This commit is contained in:
Namhyeon Go 2018-03-21 09:50:23 +09:00 committed by GitHub
parent 2adc2815db
commit aa7c424d55
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -8,6 +8,10 @@
if(!function_exists("get_web_page")) {
function get_web_page($url, $method="get", $data=array(), $proxy="", $ua="", $ct_out=45, $t_out=45) {
if(!in_array("curl", get_loaded_extensions())) {
return "cURL extension needs to be installed.";
}
$options = array(
CURLOPT_PROXY => "", // set proxy server
CURLOPT_RETURNTRANSFER => true, // return web page
@ -18,7 +22,7 @@ if(!function_exists("get_web_page")) {
CURLOPT_USERAGENT => "", // name of client
CURLOPT_AUTOREFERER => true, // set referrer on redirect
CURLOPT_CONNECTTIMEOUT => $ct_out, // time-out on connect
CURLOPT_TIMEOUT => $c_out, // time-out on response
CURLOPT_TIMEOUT => $t_out, // time-out on response
);
if(!empty($ua)) {