Meine CSV Datei enthält leider HTML Code...
Leidige Frage: Woran kann das liegen? Danke im voraus
Leidige Frage: Woran kann das liegen? Danke im voraus
PHP-Code:
if($_GET['action'] == "download")
{
require("../inc/mysql.inc.php");
$addresses = mysql_query("SELECT * FROM $db_user WHERE
status='admin' OR status='coach' OR status='member' ORDER BY status");
while ($row = mysql_fetch_array($addresses))
{
$seperator = ";";
$content = $row[firstname];
$content.= $seperator;
$content.= $row[surname];
$content.= $seperator;
$content.= $row[email];
$content.= "\n";
$csv = fopen("adressen.csv","a+");
fwrite($csv,$content);
fclose($csv);
header("Content-type: application/csv");
header("Content-Disposition: attachment; filename=adressen.csv" );
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0,pre-check=0");
header("Pragma: public");
}
}
Kommentar