Jump to content

Help with building the file name for export doc


hane

Recommended Posts

Hi for some reason I just cant get my code to work. Please take a look and help me in the right direction.

 

Here is my header builder for my export doc, $vExcelFileName is my problem:

<?php require_once('includes/connect.php');

$adid=$_GET['adid'];

mysql_select_db($database_A, $A);
$query_ads = "SELECT * FROM ads JOIN company ON ads.companyid=company.companyid JOIN contact ON contact.companyid=ads.companyid WHERE adid=$adid";
$ads = mysql_query($query_ads, $A) or die(mysql_error());
$row_ads = mysql_fetch_assoc($ads);
$totalRows_ads = mysql_num_rows($ads);

$vExcelFileName=$row_ads['name'] . "ad-description-" .  $row_ads['month'] ."-10" .  ".doc";
header("Content-type: application/x-ms-download"); //#-- build header to download the excel file
header("Content-Disposition: attachment; filename=$vExcelFileName");
header('Cache-Control: public');
?>

 

I'm sure its something silly that I'm not seeing and just need someone else to point it out

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.