I have this script to export mysql data to excel. I have tried everything but I am not able to get this script to work for IE. The script downloads the data using FireFox or Chrome but IE fails and says:
Internet Explorer cannot download list_view.php from www.mysite.com. (this is the site on which the file resides).
Internet Explorer was not able to open this Internet site. The requested site is either unavailable or cannot be found. Please try again later.
here is the code that I am using:
$sql = "SELECT...."
$result = mysql_query($sql)
or die("\nError Retrieving Records.<hr />sql: $sql<hr />ERROR:".mysql_error());
if(mysql_num_rows($result) > 0){
// build a filename that excel will use to save it as
$filename=$name."_".dateFromDB($_GET['confDate']).".xls";
// headers to force the open/save into Excel
header("Content-Type: application/vnd.ms-excel");
header("Content-Disposition: attachment; filename=$filename");
header("Pragma: no-cache");
header("Expires: 0");}?>
<table>
<thead>
<tr>
<th>address</th>
<th>phone</th>
<th>email</th>
<th>status</th>
</tr>
</thead>
<tbody>
<?php // loop over items
while ($row = mysql_fetch_array ($result, MYSQL_ASSOC)) { ?>
<tr>
<td><?=$row['address'];?></td>
<td><?=$row['phone'];?></td>
<td><?=$row['email'];?></td>
<td><?=$row['status'];?></td>
</tr><?php
}?>
</tbody>
</table><?php
exit(); // exit or it will throw an error when it tries to continue
I know there maybe some people suggesting not to use IE, but the person who is actually using the export function do not have access to different browser.
EDIT:
I forgot to mention that I am running a SSL(https). If i turn SSL off everything is working fine on IE, but the moment SSL is on the IE shows an error.
Any ideas how to make it work under SSL?