Page 1 of 1
URL problem with fopen
Posted: Fri Jul 03, 2009 1:01 pm
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...
Re: URL problem with fopen
Posted: Fri Jul 03, 2009 2:33 pm
by emix
Try cURL instead of fopen - this looks like some sort of security setting
http://lmgtfy.com/?q=php+curl
Re: URL problem with fopen
Posted: Fri Jul 03, 2009 2:48 pm
by LDusan
So it's up to the targeted site, not up to me?
Re: URL problem with fopen
Posted: Fri Jul 03, 2009 2:57 pm
by Eric!
Can you post the real link you are trying to access?
Re: URL problem with fopen
Posted: Fri Jul 03, 2009 2:59 pm
by LDusan
Re: URL problem with fopen
Posted: Fri Jul 03, 2009 3:55 pm
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....
Re: URL problem with fopen
Posted: Fri Jul 03, 2009 4:33 pm
by LDusan
Thanks a lot, I needed some page with horoscopes to practice building a little app. Thanks.