Opening files on a browser

Reply

Join Date: Feb 2006
Posts: 12
Reputation: seh1 is an unknown quantity at this point 
Solved Threads: 0
seh1 seh1 is offline Offline
Newbie Poster

Opening files on a browser

 
0
  #1
Mar 12th, 2006
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
Reply With Quote Quick reply to this message  
Join Date: Oct 2004
Posts: 348
Reputation: paradox814 is an unknown quantity at this point 
Solved Threads: 4
paradox814's Avatar
paradox814 paradox814 is offline Offline
Posting Whiz

Re: Opening files on a browser

 
0
  #2
Mar 12th, 2006
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:
  1. 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
Reply With Quote Quick reply to this message  
Join Date: Feb 2006
Posts: 12
Reputation: seh1 is an unknown quantity at this point 
Solved Threads: 0
seh1 seh1 is offline Offline
Newbie Poster

Re: Opening files on a browser

 
0
  #3
Mar 13th, 2006
Originally Posted by paradox814
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:
  1. 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:

<p>
open link in a <a href="./upload/rte.txt" target="_blank">new window</a>
</p>


Cheers,
Sean
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC