Jump to content

Links created in PHP to pdf files don't work!!


ha as

Recommended Posts

Hi

I created a MySQL database with all the pdf papers on my HD. The path to a pdf file is stored on my HD e.g. D:\Docs\Papers\Berg2003a.pdf

In php I do the query and output the link:
echo "<a href='file://" $row->pdf ."'>pdf</a>";

But when the page is generated and I click on it nothing happens. If I do right click, copy link and paste it in the browser field, the pdf file opens though! Looking at the html code, it reads in Firefox: <a href="file://D:%5CDocs%5CPapers%5Cwind03%5Cpdfs%5Berg2003a.pdf">pdf</a>
and in IE6 <a href='file://D:\Docs\Papers\wind03\pdfs\Berg2003a.pdf'>pdf</a>

I have also tried .str_replace('\\','/',$row->pdf) but with the same result.

Hope somebody can help here...

Thanks

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.