[PHP] include redirects

2002-01-29 Thread Calin Uioreanu

Hi all,

I have a problem with a redirect. I have a file that includes a content from
another PHP script,
parses the content as string with output buffering and displays it.

The problem is that the include function doesn't seem to handle redirects.
When that other
PHP script makes a Header relocate the fopen from my initial file is lost
and I get
Warning  fopen No such file or directory
I get the same when I try include.

Do you know a solution to insert remote content handling eventual redirects
in the remote?
Something like a browser.

--

Regards,
--
Calin Uioreanu
[EMAIL PROTECTED]
Tel: +49 - (0) 89 - 25 55 17 07
http://www.ciao.com
München, Germany
--



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] include redirects

2002-01-29 Thread David Otton

On Tue, 29 Jan 2002 12:51:15 +0100, you wrote:

Do you know a solution to insert remote content handling eventual redirects
in the remote?
Something like a browser.

fopen() the file you're trying to include, and handle the response
from the server yourself. If it returns 301 or 302, you have to find
the Location header, parse the URL out of it, and retry the fopen().

When you finally have a URL that returns 200 OK, include() it.

Having said that, I'd bet there's a class somewhere that will do the
response parsing for you.
http://php.resourceindex.com/Functions_and_Classes/Clients_and_Servers/HTTP/

Yes, this is a failing of the include() statement... it really should
handle HTTP response codes if it's going to do HTTP. I'm kinda
surprised it doesn't... are you certain?

djo


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]