johnnyk Posted February 25, 2006 Share Posted February 25, 2006 Warning: fopen(http://en.wikipedia.org/wiki/PHP): failed to open stream: HTTP request failed! HTTP/1.0 403 Forbidden in wikipedia.html on line 16Why is it 403ing? Is there anyway to analyze wikipedia page with php? Quote Link to comment https://forums.phpfreaks.com/topic/3596-fopen-file-readfile-all-403d/ Share on other sites More sharing options...
johnnyk Posted February 25, 2006 Author Share Posted February 25, 2006 I heard fsockopen would stop the 403, but I tried it out and it won't make a connection at all. At least I don't think it makes a connection cause the script aint working. Quote Link to comment https://forums.phpfreaks.com/topic/3596-fopen-file-readfile-all-403d/#findComment-12473 Share on other sites More sharing options...
johnnyk Posted February 26, 2006 Author Share Posted February 26, 2006 Edit: Forget it, post name confusing, started other post Quote Link to comment https://forums.phpfreaks.com/topic/3596-fopen-file-readfile-all-403d/#findComment-12497 Share on other sites More sharing options...
hitman6003 Posted February 26, 2006 Share Posted February 26, 2006 This will get you started.You will need to make sure that the cURL extension is enabled.[code]$page = "http://en.wikipedia.org/wiki/PHP";function processURL($url){ $url=str_replace('&','&',$url); $ch=curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); $xml = curl_exec ($ch); curl_close ($ch); echo $xml;}echo processURL($page);[/code]Read the manual pages on cURL as well:[a href=\"http://www.php.net/curl\" target=\"_blank\"]http://www.php.net/curl[/a] Quote Link to comment https://forums.phpfreaks.com/topic/3596-fopen-file-readfile-all-403d/#findComment-12519 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.