Status
Not open for further replies.
7 comments
curl

thanks for answer
but it gave me an error
Code:
Warning: curl_setopt_array() [function.curl-setopt-array]: CURLOPT_FOLLOWLOCATION cannot be activated when safe_mode is enabled or an open_basedir is set in /home/*****/domains/*****/public_html/xray.php on line 18

im using this code
PHP:
<?php
$url="http://www.xraygaming.com/screenshotlink.php?guid=0000012b43ce138b286f24320043001700060014";
function get_web_page( $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
    );

    $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 );

    $header['errno']   = $err;
    $header['errmsg']  = $errmsg;
    $header['content'] = $content;
    return $header;
}

$result = get_web_page( $url );


$page = $result['content'];
echo $page;
?>
 
I dont think your safe mode is off because the following is coming up.

Code:
URLOPT_FOLLOWLOCATION cannot be activated when safe_mode is enabled
 
You can turn open_basedir off by doing this..

Open Apache configuration file, httpd.conf, with the following line: php_admin_value open_basedir none

try that then try doing the code again..
 
Status
Not open for further replies.
Back
Top