Re: Problems with headers in redirect

From: Date: Tue, 13 Nov 2001 14:24:20 +0000
Subject: Re: Problems with headers in redirect
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-74494@lists.php.net to get a copy of this message
Hi Richy, Try sending the content header before the location header: header("Content-type: image/jpeg"); header("Location: http://yourhost.com/yourfile.jpg"); HTH, John >Hi, I'm hoping someone can help me with this one... > >I'm doing redirects to various types of file (Flash, Office, DWF etc) and >have found a problem with IE5. > >I pass the script a document ID, and it retrieves the document record from >a database, which stores the location of the file on the web server, and >redirects the browser to the document. > >What happens is that the browser gets redirected, but doesn't get the >content-type header, and subsequently can't display the document. > >Until yesterday I was using javascript redirection, which worked fine. >However for other reasons (ie that didn't work with IE 5.5 or IE6) I had to >change to using the header("Location: ") way. > >Only work around I can see is to do the redirection based on browser type >(i.e. one way for IE5, the other for IE5.5/IE6) but thats messy. > >Any other ideas??? > >Richy -- /* SteeleSoft Consulting John Steele - Systems Analyst/Programmer * We also walk dogs... Dynamic Web Design PHP/MySQL/Linux/Hosting * www.steelesoftconsulting.com jsteele@steelesoftconsulting.com */

« previous php.general (#74494) next »