Click here to Skip to main content
15,396,019 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hello everyone,

I have a website. I am developing it to develop myself.

My Database conists of 3 tables. 1 is for the content.
I seperated a column for the pdf file directory(type is varchar). ie (files/pdffiles/example.pdf)

The problem is that;how can i add the true file directory and point the exact pdf.

and how can i download it to my computer by clicking the link?

Here is my code;

HTML
 <section class="accordionMod">
    <div class= "yardimbaslik">
    <h2 title = "U ve Ü harfiyle başlayan yardım konuları"> <span>U-Ü</span></h2>
    </div>
    <?php
   $sql =mysql_query("SELECT * FROM problemler WHERE baslik LIKE 'U%' or baslik LIKE 'Ü%' ORDER BY baslik ASC") or die("SORGU HATASI");
    while ($row = mysql_fetch_array($sql)) {
        $baslik = $row['baslik'];
        $icerik = $row['icerik'];
        $youtube_link = $row['youtube_link'];
        $pdf_link = $row['pdf_link'];
        $download_link = $row['download_link'];
        $oy_orani = $row ['oy_orani'];
   ?>
     <div>
        <h3 class="accordion-toggle"><?echo $baslik?></h3>
        <section class="accordion-inner">
            
                <div class ="sosyal_buton">

                        <a href=<?php echo $download_link ?>><img src = "themes/images/indir.png"></a><a href=<?php echo $pdf_link.'.pdf'?>><img src = "themes/images/pdf.png"></a><a href=<?php echo $youtube_link ?>><img src = "themes/images/youtube.png"></a>
                </br>
                <br/>
                </div>
            <div class = "icerik_alt">
                <p><?php echo $icerik?></p>
            </div>

    </div>  
    <?php
}
?>
</section>
Posted

1 solution

Just provide your fully qualified pdf root path from database out value in href for example "ExampleFolderName\rootPDFFolderName\PDFName.pdf", so you can able to download the pdf by onclick the link.
   
Comments
FoxRoot 13-Aug-13 9:15am
   
what about blanks ? for example "this is an example .pdf"

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900