Ed_279 15 Newbie Poster

I changed the position of the header(...) lines to be above file_get_contents(...) and I think fixed the use of the file name (filename=".$file) but the image is the same. I surely have to echo the contents after getting them.

<html>
<head>
    <title>Bridge Scores</title>
</head>
<body>
    <a href="index.php">Back to Result List</a>
<?php
    $file = $_GET['file'];
    header("Content-type:application/pdf");
    header("Content-Disposition:attachment; filename=".$file);
    $contents = file_get_contents($file);
    // note contents will have new lines so we keep these and don't
    // add the <br /> tags since then we'll have an extra blank line
    echo("<p><pre>");
    echo($contents);
    echo("</pre></p>");
?>
    <a href="mailto:emitchell@ieee.org">Report Problems</a>
</body>
</html>
rproffitt commented: This appears to break the rule "The webpage needs to be either HTML or a PDF file, not both." +15