Jump to content
  • Advertisement
Sign in to follow this  

[web] [PHP] fopen(): Special requirements for external file? [RESOLVED]

This topic is 5060 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Resolved: Turns out it's a problem with authentication, as it works if I duplicate the HTML of the page and point the URL to that.
Having taken over an existing website, we've moved it to our hosting - but have run into a few problems. We're running an oldish version of PHP (4.1 - argh!) but seem to have ironed out the bulk of issues. One script that is puzzling me is one that reads a feed and dumps down the data. Fair enough, it loads this page. Or rather, it doesn't. When fopen($url, "r"); tries to read the file it doesn't return a pointer to the stream as it should. The URL is correct... so this is where I need help. Do I need to set up something to allow PHP to access external files? The script is:
		//Open the file
		$handle = @fopen($this->url,"r"); 
		if (!$handle) {
			echo "Could not create pointer to stream... bailing out.<br />";
If I "un-@" the fopen() command, I get this cryptic error: Warning: fopen("http://www.futuresource.com/iFS/quotes.asp?cID=SFSIS&symbols=lfty,daxy,spy,nqy,ty1-,gc1-,fxbpusmul,fxeuusmul,fxussfmul,fxusjymul&title=General", "r") - Success in /includes/grab_class.php on line 88 It warns me that it was successful? Huh? EDIT: Ah. If you copy-paste the URL it works... if you click the link in my post, you get access denied. Possibly related..? But surely if not, I'd get a pointer to the stream that contained the "Access Denied" message? [Edited by - benryves on January 6, 2005 6:09:27 AM]

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!