Tell me more ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I have a small problem with the php content-disposition, I kind of understand where the problem lies but I have no idea how to solve it (new to using databases). Calling this php page will result in not showing any of the echos and only showing the download box, which I intended for the "cv" only (not sure if it's working that way, because the downloadable file I receive cannot be opened)

Removing the header(content... line will result in showing the echos, but I won't be able to download the specified file. I want it to show as a link which would download its contents when clicked.

$newEmployeeName = $_POST['name'];
$newEmployeeArea = $_POST['area'];
$newEmployeeCV   = $_POST['cv'];

include('databaseConnection.php');

$result = mysql_query("SELECT * FROM participants");

while($row = mysql_fetch_array($result))
{
  $download_me = $row['cv'];
  header("Content-Disposition: attachment; filename=$download_me");

  echo $row['name'] . " " . $row['area_of_exp'] . " " . $download_me;
  echo "<br />";
}
share|improve this question

closed as off topic by John Conde Jan 19 at 14:43

Questions on Webmasters Stack Exchange are expected to relate to webmastering within the scope defined in the FAQ. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about closed questions here.