|
Posted by gagal on 07/20/07 20:07
I'm beginning to think I'm the queen of it worked before ... I used
this exact same page on another website I did. It worked
beautifully. On my site, it doesn't work. Instead of opening in
excel I get:
All of my data and ...
Warning: Cannot modify header information - headers already sent by
(output started at /home/smith/public_html/addressbook/ab_print.php:6)
in /home/smith/public_html/addressbook/ab_print.php on line 70
Warning: Cannot modify header information - headers already sent by
(output started at /home/smith/public_html/addressbook/ab_print.php:6)
in /home/smith/public_html/addressbook/ab_print.php on line 71
Warning: Cannot modify header information - headers already sent by
(output started at /home/smith/public_html/addressbook/ab_print.php:6)
in /home/smith/public_html/addressbook/ab_print.php on line 72
Warning: Cannot modify header information - headers already sent by
(output started at /home/smith/public_html/addressbook/ab_print.php:6)
in /home/smith/public_html/addressbook/ab_print.php on line 73
<HTML>
<HEAD>
</HEAD>
<BODY>
<?PHP include("../includes/connect.txt"); ?>
<?PHP
$sql = "SELECT * FROM $db_table4 ORDER BY category ASC, business ASC,
lastName ASC, firstName ASC";
$result = mysql_query ($sql, $connect) or die ('Query failed:
' .mysql_error());
echo "<TABLE CELLSPACING='2' CELLPADDING='2' BORDER='1'>";
echo "<TR>";
echo "<TD CLASS='title'>Category</TD>";
echo "<TD CLASS='title'>Business</TD>";
echo "<TD CLASS='title'>Name</TD>";
echo "<TD CLASS='title'>Address</TD>";
echo "<TD CLASS='title'>Address</TD>";
echo "<TD CLASS='title'>City</TD>";
echo "<TD CLASS='title'>State</TD>";
echo "<TD CLASS='title'>Zip</TD>";
echo "<TD CLASS='title'>Phone</TD>";
echo "<TD CLASS='title'>Cell</TD>";
echo "<TD CLASS='title'>Email</TD>";
echo "<TD CLASS='title'>Alternate Email</TD>";
echo "<TD CLASS='title'>AIM</TD>";
echo "<TD CLASS='title'>Notes</TD>";
echo "</TR>";
while ($row = mysql_fetch_array ($result))
{
echo "<TR>";
$business = $row['business'];
$lastName = $row['lastName'];
$firstName = $row['firstName'];
$category = $row['category'];
$telephone = $row['telephone'];
$area = substr($telephone,0,3);
$exchange = substr($telephone,3,3);
$rest = substr($telephone,6,4);
$cellphone = $row['cellphone'];
$areac = substr($cellphone,0,3);
$exchangec = substr($cellphone,3,3);
$restc = substr($cellphone,6,4);
$address1 = $row['address1'];
$address2 = $row['address2'];
$city = $row['city'];
$state = $row['state'];
$zip = $row['zipcode'];
$email1 = $row['email1'];
$$email2 = $row['$email2'];
$aimid = $row['aimid'];
$url = $row['url'];
$notes = $row['notes'];
echo "<TD>$category</TD>";
echo "<TD>$business</TD>";
echo "<TD>$lastName, $firstName</TD>";
echo "<TD>$address1</TD>";
echo "<TD>$address2</TD>";
echo "<TD>$city</TD>";
echo "<TD>$state</TD>";
echo "<TD>$zip</TD>";
echo "<TD>($area) $exchange-$rest</TD>";
echo "<TD>($areac) $exchangec-$restc</TD>";
echo "<TD>$email1</TD>";
echo "<TD>$email2</TD>";
echo "<TD>$aimid</TD>";
echo "<TD>$notes</TD>";
echo "</TR>";
}
echo "</TABLE>";
header("Content-type: application/octet-stream");
header("Content-Disposition: attachment; filename=addressbook.xls");
header("Pragma: no-cache");
header("Expires: 0");
?>
</BODY>
</HTML>
Navigation:
[Reply to this message]
|