I have been using fsockopen() to access remote web pages for processing without any problems (until now).
Example data:
URL: http://www.dvdstreet.infront.co.uk/cgi-bin/show?key=dvd-CDR30990
If you go to the URL shown above, you will get redirected to another page. How is this done? Why can't I find any reference to a redirect in the headers I get back?
Here's the story:
I open a socket on port 80 (HTTP) using fsockopen and then use the data shown above to derive an HTTP REQUEST:
e.g.
open HOST: www.dvdstreet.infront.co.uk
use PATH: cgi-bin/show?key=dvd-CDR30990
REQUEST:
GET /cgi-bin/show?key=dvd-CDR30990 HTTP/1.0
My script reports:
Completed page read (17 lines found)
And the HTTP headers returned are:
HTTP/1.1 302 Found
Date: Fri, 22 Jun 2001 19:04:45 GMT
Server: Apache/1.3.19 (Unix) ApacheJServ/1.1
Location: http://www.infront.co.uk/?key=dvd-CDR30990
Connection: close
Content-Type: text/html; charset=iso-8859-1
And the page returned says:
Found
The document has moved here.
When I click on the link behind the word "here", it doesn't go to the same page that I would see in my browser.
What is going on? Have I lost the plot here somewhere?
All help gratefully received.
Richard