Results 1 to 8 of 8
-
7th Oct 2010, 02:34 PM #1OPMember
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
thanksEXOT!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
-
7th Oct 2010, 02:42 PM #2MemberWebsite's:
scrls.co.ukTry 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
-
7th Oct 2010, 03:25 PM #3OPMember
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
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;
?>
-
7th Oct 2010, 04:13 PM #4Member
I doubt you could use CURL since you have Safe Mode switched on your host.
-
7th Oct 2010, 04:17 PM #5OPMember
safe mode is OFF not on
-
7th Oct 2010, 04:22 PM #6MemberWebsite's:
scrls.co.ukI dont think your safe mode is off because the following is coming up.
Code:URLOPT_FOLLOWLOCATION cannot be activated when safe_mode is enabled
-
7th Oct 2010, 05:17 PM #7OPMember
...or an open_basedir is set....
-
7th Oct 2010, 05:19 PM #8MemberWebsite's:
scrls.co.ukYou 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..
Sponsored Links
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
Content Locker for Wordpress Login Page
By Tennouji in forum WordpressReplies: 0Last Post: 9th Nov 2012, 10:04 AM -
How to toggle Adult/NSFW content on main page (Wordpress)?
By futureawesome in forum WordpressReplies: 2Last Post: 20th Mar 2012, 06:21 PM -
Looking for a content-locker until page is facebook-liked
By xexmodder in forum Webmaster DiscussionReplies: 2Last Post: 12th Dec 2011, 06:37 AM -
Reload content without page refresh
By AmN in forum Web Development AreaReplies: 7Last Post: 5th May 2011, 07:49 AM -
How to Reveal Hidden Content by Ajax Thanks without refreshing page
By vorazeal in forum IP.BoardReplies: 4Last Post: 12th Jan 2011, 06:06 AM
themaCreator - create posts from...
Version 3.22 released. Open older version (or...