Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Putting a text/doc file into a php page

Status
Not open for further replies.

mts9105

Programmer
Apr 1, 2004
1
US
I am writing a page that allows users to upload images and documents onto my site and then the site will display them. I was wondering how to get a doc to display on the page.
 
I'm not sure is this is the answer to your question or not, but I think you want to open a text document, read the content and then display it on the screen. You may want to read on PHP functions like:
fopen()
fread()
fgets()

I hope that helps.
 
If you just want to display text files, look at the fpassthru function, but if it's something exotic like microsift word you will have to do some fancy stuff e.g.

convert the .doc file into HTML with a 3rd party tool
allow word to fire up on the client PC to view it
Look at the ms office section on the microsoft web site which have ofice file viewers to download (which allow you to view word and excell file without having the full product) which you could include a link to for users to access if the need to.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top