errors after downloading a .csv file from php

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
i created a button for my user to download their datas (.csv).
everything goes well but after u save/download the file. the website
seems to stop working.

i got two frames, the left frame is a list of menus for the users such
as add records, view records, logout etc. the right(main) frame are the
contents of what the had selected. For example: the users can click on
the "View Records" function on the left, then the main frame will show
3 buttons: "View all" "Search" "Download". if they click download and
save the file. the left frame doesn react if the user try to click add
record or other func. But if the user click cancel when the dialog box
which ask them to download appears, everything goes back to normal. Or
after downloading, if they click "View all" "Search" it also goes back
to normal. so wat's wrong? below is the coding:

<form action="" method="post">
<input type="submit" name="download" value="Download"> Click here to
download the data

header("Content-type: text/csv");
header("Content-Disposition: attachment; filename=data.csv");
print ("field1,field2,field3")."\n";
$query = "SELECT * FROM data";
$result = mysql_query($query);
while($row = mysql_fetch_row($result)){
  print implode(",", $row)."\n";
echo $a;

Re: errors after downloading a .csv file from php

by the way, this only occurs in IE6.0, it works perfectly in IE7.0 or
opera... Thanx...

Site Timeline