Re: Re: auto download

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jens Kleikamp wrote:
Benjamin Adams wrote:

I have three links. The code already auto selects one.
I'm trying to take that one link and automaticly start the download.
I tryed with header('location:$link');
but it tells me "Warning: Cannot modify header information"
what would I use to start downloading?
one of the link is another page so I need it to pop up in a new window.

Thanks for any help

Moin,

You can´t start the browsers download dialog if you already sent any data. No header(), echo(), print() etc.

not completely true. you can call header() many times, IIRC even
over writing specific previous calls e.g.

<?php
header('Location: http://www.foo.com');
header('Location: http://www.bar.com');
exit

would send the user to bar.com (ask him to buy all a drink).
essentially the headers are not sent until output in initiated.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux