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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do you get, print current file location in php 1

Status
Not open for further replies.

tyhand

Programmer
Jul 3, 2002
186
0
0
US
Hi all,

I imagine the answer is simple but I can't figure it out.

I want to be able to print and place in an anchor (link)
the name of the current file a user is viewing
using php and html.

Using "ThisFile.html" as an example, I want
to be able to print on the page:
'You are currently browsing --
<a href=[php code here?]>Whatever</a>'

I am using $_server('php_self') which works if the file
ends with ".php". However I want to be able to do this
using just plain HTML pages.

Thanks all. Peace!

- tyhand
 
PHP will just work with files that are interpreted by the server. If .html is not evaluating the PHP code, then you are out of luck since it is plain, static HTML.
You could revert to client side code using JavaScript and use document.location to populate the link.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top