Login   Register  
PHP Classes
elePHPant
Icontem

file_get_contents problem

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us

      MySite with Wikipedia  >  All threads  >  file_get_contents problem  >  (Un) Subscribe thread alerts  
Subject:file_get_contents problem
Summary:403 Forbidden Error
Messages:3
Author:bart venken
Date:2008-01-12 19:32:38
Update:2008-10-01 20:12:05
 

  1. file_get_contents problem   Reply   Report abuse  
Picture of bart venken
bart venken
2008-01-12 19:32:38
Hi,

I downloaded the MySite with Wikipedia class and uploaded it to my server (it's not on my local). When opening get_page_example.php, I get the following error :

Warning: file_get_contents(http://en.wikipedia.org//wiki/Content_Management_System) [function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.0 403 Forbidden in /web/www.grenouille-webdesign.be/html/musicadmin/wikipedia.class.php on line 14

I'm not much of a tech guy, but I read some things about wrappers (whatever they may be :o))
I checked the allow_url_fopen setting and it's 'on' for both local and master.

Anyone any idea what could be going wrong and/or what I can/should do to make this work?

Thnx in advance,
Bart

  2. Re: file_get_contents problem   Reply   Report abuse  
Picture of bart venken
bart venken
2008-01-12 19:36:23 - In reply to message 1 from bart venken
ok. found it.
this was the code :

<?PHP
include 'wikipedia.class.php';
$x = new wikipedia('http://en.wikipedia.org/');
echo $x->get_page('Content_Management_System', false);
?>

i just had to remove the slash at the end of the url.

btw : great class!

bart

  3. Re: file_get_contents problem   Reply   Report abuse  
Picture of BARLOT marc
BARLOT marc
2008-10-01 20:12:05 - In reply to message 2 from bart venken
thanks for the tip