mirror of
https://github.com/SabreTools/wizzardRedux.git
synced 2026-09-22 06:44:19 +00:00
Moving all files out of unnecessary subfolder
This commit is contained in:
43
includes/functions.php
Normal file
43
includes/functions.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
/*------------------------------------------------------------------------------------
|
||||
House all miscellaneous helper functions
|
||||
Original code by Matt Nadareski (darksabre76)
|
||||
-----------------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* Get a web file (HTML, XHTML, XML, image, etc.) from a URL. Return an
|
||||
* array containing the HTTP server response header fields and content.
|
||||
*
|
||||
* @link http://nadeausoftware.com/articles/2007/06/php_tip_how_get_web_page_using_curl
|
||||
* @link http://stackoverflow.com/questions/4372710/php-curl-https
|
||||
*
|
||||
* @param $url
|
||||
*/
|
||||
function get_data($url)
|
||||
{
|
||||
$options = array(
|
||||
CURLOPT_RETURNTRANSFER => true, // return web page
|
||||
CURLOPT_HEADER => false, // don't return headers
|
||||
CURLOPT_FOLLOWLOCATION => true, // follow redirects
|
||||
CURLOPT_ENCODING => "", // handle all encodings
|
||||
CURLOPT_USERAGENT => "spider", // who am i
|
||||
CURLOPT_AUTOREFERER => true, // set referer on redirect
|
||||
CURLOPT_CONNECTTIMEOUT => 120, // timeout on connect
|
||||
CURLOPT_TIMEOUT => 120, // timeout on response
|
||||
CURLOPT_MAXREDIRS => 10, // stop after 10 redirects
|
||||
CURLOPT_SSL_VERIFYPEER => false // Disabled SSL Cert checks
|
||||
);
|
||||
|
||||
$ch = curl_init( $url );
|
||||
curl_setopt_array( $ch, $options );
|
||||
$content = curl_exec( $ch );
|
||||
$err = curl_errno( $ch );
|
||||
$errmsg = curl_error( $ch );
|
||||
$header = curl_getinfo( $ch );
|
||||
curl_close( $ch );
|
||||
|
||||
return $content;
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user