I just spent the last 5 hours on this issue. I'm not the best PHP programmer and that may be why. But I'm officially throwing in the towel...here goes.
I wrote a web site for a company and they insisted I link the main content for every page to their little wiki clone; since they were too cheap to have me write a DB and interface.
I wrote the site including a script that pulls the remote content using fopen contents. Everything is peachy. Works great on my home testing server. Works on my hosted server (1and1 hosting); but I set it up on their server and it won't fopen the pages.
Their wiki program lives on the same server as their web site but here's the thing. It will grab their main page and it will grab pages from other sites.
My best guess is that there is a security issue on the directories some layers down in their wiki program. But then I wonder why I could fopen those pages from 2 other locations. To access the site I'm forced to use an SSH shell.
So, if this is a security issue what do I need to tell them to do?
Things I've tried: I've tried using their IP rather than their DNS entry. Reading everything on the entire innnnernet about fopen and related functions.
For the record here's my code:
if ($filetext = fopen("http://www.medvis.com/twiki/bin/view/Main/MedvisWelcome?cover=plain", "r"))
{
while (!feof($filetext))
{
$data = fgets($filetext, 2048);
$pagedata .= "$data";
}
}
fclose($filetext);
There's a bit more but that's essentially it. Nothing fancy at all, just cram the text on the page. I strip a bunch of junk out after this point but I can't even get that far.
Holy crap, I'm tired. Someone much smarter than me please help me out 🙁.