URL problem with fopen

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
LDusan
Forum Commoner
Posts: 45
Joined: Sun Mar 08, 2009 5:03 am
Location: Belgrade, Serbia

URL problem with fopen

Post by LDusan »

I am having problem, when I try to open URL like fopen ("www.abc.com/def/gde", "r"), it works fine but it opens just the index page (http://www.abc.com) and not the entire URL. How can that be fixed? Thanks a lot...
User avatar
emix
Forum Newbie
Posts: 8
Joined: Mon Jun 22, 2009 10:32 am
Location: Poland

Re: URL problem with fopen

Post by emix »

Try cURL instead of fopen - this looks like some sort of security setting
http://lmgtfy.com/?q=php+curl
LDusan
Forum Commoner
Posts: 45
Joined: Sun Mar 08, 2009 5:03 am
Location: Belgrade, Serbia

Re: URL problem with fopen

Post by LDusan »

So it's up to the targeted site, not up to me?
Eric!
DevNet Resident
Posts: 1146
Joined: Sun Jun 14, 2009 3:13 pm

Re: URL problem with fopen

Post by Eric! »

Can you post the real link you are trying to access?
LDusan
Forum Commoner
Posts: 45
Joined: Sun Mar 08, 2009 5:03 am
Location: Belgrade, Serbia

Re: URL problem with fopen

Post by LDusan »

Eric!
DevNet Resident
Posts: 1146
Joined: Sun Jun 14, 2009 3:13 pm

Re: URL problem with fopen

Post by Eric! »

My guess is this link is actually a script that is checking for non-browser connections and feeding the homepage HTML to keep people from sucking their horoscopes. You'll probably need cURL to fake a browser headers to read the page. Their page is copyrighted anyway....
LDusan
Forum Commoner
Posts: 45
Joined: Sun Mar 08, 2009 5:03 am
Location: Belgrade, Serbia

Re: URL problem with fopen

Post by LDusan »

Thanks a lot, I needed some page with horoscopes to practice building a little app. Thanks.
Post Reply