Hi,
This is driving me nuts - all help appreciated!
The problem is that I can never get the html stuff output *after* having
included "download.inc" because of the "exit;" call -- which I have to have
else the html gets output and downloaded as well (and I don't understand why
fpassthru doesn't stop at EOF on $fp).
Is there any way to do this without the user having to click on yet another
link/button somewhere?
Donna
User clicks on a link in pageA.html:
<a href="./cribs.html?action=downloadtxt"><u>Download TXT</u></a>
cribs.html:
<?php
if ( $action == 'downloadtxt' ) {
include( '../include/downloadtxt.inc' );
$action = 'howto';
}
if ( $action == 'howto' ) {
?>
<html>
... more html stuff here
</html>
<?php
}
?>
downloadtxt.inc:
<?php
create a txt file, and then:
header( "Content-Transfer-Encoding: base64" );
... more header stuff
$fp = fopen( "$txtfile", "r" );
fpassthru( $fp );
exit;
?>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php