Activity Stream
48,167 MEMBERS
6862 ONLINE
besthostingforums On YouTube Subscribe to our Newsletter besthostingforums On Twitter besthostingforums On Facebook besthostingforums On facebook groups

Results 1 to 8 of 8
  1.     
    #1
    Member

    Default Retrieving page content PHP

    hi,
    is there a way to get a webpage content in PHP with cURL?

    like i make the cURL visit this webpage
    http://www.xraygaming.com/screenshot...43001700060014

    then this webpage will give me another link
    i need that link but in php because the users will have different GUID that you can see in the url

    thanks
    EXOT!C_ Reviewed by EXOT!C_ on . Retrieving page content PHP hi, is there a way to get a webpage content in PHP with cURL? like i make the cURL visit this webpage http://www.xraygaming.com/screenshotlink.php?guid=0000012b43ce138b286f24320043001700060014 then this webpage will give me another link i need that link but in php because the users will have different GUID that you can see in the url thanks Rating: 5


  2.   Sponsored Links

  3.     
    #2
    Member
    Website's:
    scrls.co.uk
    Try using this .. Don't know if it will help but i just googled "how to retrieve PHP content using CURL".

    http://nadeausoftware.com/articles/2...age_using_curl

  4.     
    #3
    Member

    Default 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 Code: 
    <?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;
    ?>


  5.     
    #4
    Member
    I doubt you could use CURL since you have Safe Mode switched on your host.

  6.     
    #5
    Member
    safe mode is OFF not on


  7.     
    #6
    Member
    Website's:
    scrls.co.uk
    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

  8.     
    #7
    Member
    ...or an open_basedir is set....


  9.     
    #8
    Member
    Website's:
    scrls.co.uk
    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..

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Content Locker for Wordpress Login Page
    By Tennouji in forum Wordpress
    Replies: 0
    Last Post: 9th Nov 2012, 10:04 AM
  2. Replies: 2
    Last Post: 20th Mar 2012, 06:21 PM
  3. Looking for a content-locker until page is facebook-liked
    By xexmodder in forum Webmaster Discussion
    Replies: 2
    Last Post: 12th Dec 2011, 06:37 AM
  4. Reload content without page refresh
    By AmN in forum Web Development Area
    Replies: 7
    Last Post: 5th May 2011, 07:49 AM
  5. Replies: 4
    Last Post: 12th Jan 2011, 06:06 AM

Tags for this Thread

BE SOCIAL