944,123 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 1629
  • PHP RSS
Mar 12th, 2006
0

Opening files on a browser

Expand Post »
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
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
seh1 is offline Offline
12 posts
since Feb 2006
Mar 12th, 2006
0

Re: Opening files on a browser

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:
PHP Syntax (Toggle Plain Text)
  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
Reputation Points: 13
Solved Threads: 4
Posting Whiz
paradox814 is offline Offline
351 posts
since Oct 2004
Mar 13th, 2006
0

Re: Opening files on a browser

Quote 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:
PHP Syntax (Toggle Plain Text)
  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
Reputation Points: 10
Solved Threads: 0
Newbie Poster
seh1 is offline Offline
12 posts
since Feb 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: Not sending Feedback Form
Next Thread in PHP Forum Timeline: page doesnt load in opera and warning to IE users doesnt show help please?





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC