[PHP] Re: Problem with Header!

2001-11-16 Thread George Whiffen

Yeah, 

It seems to be a black art to get the browsers to behave properly.

I don't know if it's relevant but I use Content-disposition and Content-type
rather than Content-Disposition and Content-Type and it seems to work for
me for "inline;".  I haven't tried "inside;".

If you really can't get it working, I guess there is a pretty kludgy
workaround available (at least with Apache) by doing a redirect to the "filename" 
first and then
getting your script to pretend to be that file and just return the result anyway.  If 
you can
guarantee that your file will
NOT exist, you could for instance get Apache to go to your php script on
a 404 not found.  So the sequence goes:

1. Request comes to your script
2. Your script immediately redirects to the filename you want to be.
3. Apache fails to find the file and calls your script as the "error
handler".
4. Your script then correctly executes and returns the appropriate 
results.

Or maybe there is some very clever trick that could be done with the
Apache rewrite module, but that's another black art!

You might want to try a post to Apache or another http mailing list.

Regards 

George 




and then
making sure there is something there to supply your result 
For downloads of tab data:

   header("Content-type: text/tab-separated-values");
   header("Content-disposition: inline; filename=missing.txt");
seems to work.


Andre Lacour wrote:
> 
> I want to sent a script-result as a renamed html-document to the client.
> I tried:
> 
> - header("Content-Disposition: inside; filename=name.html");
> 
> - header("Content-Disposition: inside; filename=\"name.html\"");
> 
> - header("Content-Disposition: inside;");
>   header("Content-filename=name.html");
> 
> even with a content-type: text/html...
> but it doesn't work.
> 
> inside replaced by something other like attachement or inline does not work,
> either!
> 
> someone an idea?
> thx

-- 
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]




[PHP] Re: Problem with header()

2001-09-05 Thread _lallous

I'm not sure if this will help but try putting an ob_start() as the first
line, and just flush the output and redirect with Header()

"Alex Shi" <[EMAIL PROTECTED]> wrote in message
00e801c135bb$2f75a480$0105050a@pony">news:00e801c135bb$2f75a480$0105050a@pony...
> Hi,
>
> Can anyone tell me why header() cannot been used after any network
> operation?
>
> In my script, there are following steps:
>
> 1).a socket is opened for smtp;
> 2).send email;
> 3).closed the socket;
> 4).use header() to redirect to another page.
>
> If no 1), 2) and 3), 4) can be processed without any problem. But if
> socket steps added, system will send warning message: Cannot add
> header information - headers already sent by ( output started at.)
>
> So, it seems like fsockopen will cause a header to be sent and other
> header cannot been sent after that within same scritp even though
> the socket is closed. Now my question is how can the second header
> been sent?
>
> Alex
>
>



-- 
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]