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?


User clicks on a link in pageA.html:
<a href="./cribs.html?action=downloadtxt"><u>Download TXT</u></a>

if ( $action == 'downloadtxt' ) {
  include( '../include/downloadtxt.inc' );
  $action = 'howto';
if ( $action == 'howto' ) {
 ... more html stuff here

  create a txt file, and then:
  header( "Content-Transfer-Encoding: base64" ); 
  ... more header stuff
  $fp = fopen( "$txtfile", "r" );
  fpassthru( $fp );

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

Reply via email to