Hi, A page is loaded from two different places. 1st call: <a href=cribsheet.html?action=*> 2nd call: <a href=cribsheet.html?action=*&download=txt>
Inside cribsheet.html: if ( $action == '*') { if ( isset( $download ) { downloadFile( $download ); } echo '<html>'; echo '<head>'; ... echo '</body> '; echo '</html>'; } function downloadFile( $type ) { header ... $fp = fopen( "$txtfile", "r" ); fpassthru( $fp ); exit; /* need "exit" else the rest of the script is output as well */ } On the first call everything is fine. On the 2nd call (of course) the script stops execution. even sending "header( Location: otherfile.html)" won't work 'cos I get a msg saying headers already sent. I *think* my problem is working out how to structure which file contains what but for the life of me I can't figure it out - just go round in circles. Donna -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php