Hyperlink to document

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
geeshan
Forum Newbie
Posts: 10
Joined: Fri Mar 24, 2006 12:02 am

Hyperlink to document

Post by geeshan »

How do I create a link to a doc file.

is the normal "include(file :///c:\aa.doc)" works.

is there any way to do this.

Geeshan
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

like any other link

Code: Select all

<a href="url">text</a>
geeshan
Forum Newbie
Posts: 10
Joined: Fri Mar 24, 2006 12:02 am

Post by geeshan »

But the thing is I'm in a middle stage.

My first page has the link.
when it clicked I want to get the click event.
So I redirect it into another page and update database.
after updating the database how I redirect it to open the doc file.

Many thanks
Geeshan.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

well, there's header('Location: ...') redirection and <meta http-equiv="..."> tag redirection. Both of which should be output, incase the user's agent doesn't support header redirection.
geeshan
Forum Newbie
Posts: 10
Joined: Fri Mar 24, 2006 12:02 am

Post by geeshan »

Thanks

I checked the http://php.net/function.header .
It gave me a lot.

But the (Location : ...) concern with the "http:// ". isnt it.
Does it redirect to a word file if we use it like this?

header('Location : c:\aa.doc');

Rgds
Geeshan
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post by s.dot »

the document should be inside of your webservers document root

then

Code: Select all

header("Location: http://www.yourdomain.com/path/to/your/file.doc");
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
Post Reply