954,604 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Opening files on a browser

Hi,
I have text files/notes/pdfs etc in a folder that I want the names of to appear on one of my php pages and then I want the doc/pdf to appear in a seperate browser window (or the same window) when the user clicks on the name. Is this possible using PHP? I have some code to open images like this but beyond that I'm finding it hard to get any information/code.

If anyone knows anything about this or have some code examples or even a link it would be appreciated.
Thanks
Sean

seh1
Newbie Poster
12 posts since Feb 2006
Reputation Points: 10
Solved Threads: 0
 

it's possible to do this in HTML, no need to do this in html, when you make the link simple add a target="_blank" in the anchor text
here is an example:

open link in a <a href="http://www.daniweb.com/" target="_blank">new window</a>


as far as I know there is no way to do this in PHP, but who cares, html is better in this situation

paradox814
Posting Whiz
351 posts since Oct 2004
Reputation Points: 13
Solved Threads: 4
 

it's possible to do this in HTML, no need to do this in html, when you make the link simple add a target="_blank" in the anchor text here is an example:

open link in a <a href="http://www.daniweb.com/" target="_blank">new window</a>

as far as I know there is no way to do this in PHP, but who cares, html is better in this situation

Thanks for the reply. Still having problems getting this code to work though.
So if I wanted to open a txt file called "rte.txt" in a folder called "upload" that is in the same directory as my html page would the code be:
open link in a new window

Cheers,
Sean

seh1
Newbie Poster
12 posts since Feb 2006
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You