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 ''."\n";
echo '<head>'."\n";
...
echo </body>
echo
}
function downloadFile( $type ) {
header ...
header ...
$fp = fopen( "$txtfile", "r" );
fpassthru( $fp );
exit;
/ "exit" is needed else the rest of the script is output to the file 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.
Donna