By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,303 Members | 1,260 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,303 IT Pros & Developers. It's quick & easy.

show folder name script?

P: 12
Hi people

I'm new to php
my problem is i want the title of my html page to be shown as the title of the folder it is inside. I know php can do a script like that.

and my next problem is how do i write the folder name as plain text in html?
Feb 11 '08 #1
Share this Question
Share on Google+
7 Replies


ronverdonk
Expert 2.5K+
P: 4,258
You get the foldername and place it within the <title> statement at the top of your page, e.g.
[php]
<?php
echo '<title>'.basename(realpath('./')).'</title>';
?>
[/php]

Ronald
Feb 11 '08 #2

harshmaul
Expert 100+
P: 490
Are you trying to re-write the url?

theres alot to go through with that your better of skimming through this link...

http://corz.org/serv/tricks/htaccess2.php
Feb 11 '08 #3

ronverdonk
Expert 2.5K+
P: 4,258
Are you trying to re-write the url?

theres alot to go through with that your better of skimming through this link...

http://corz.org/serv/tricks/htaccess2.php
I don't think re-writing url is the question here. It simply wants to display the name of the current folder in the <title> with PHP.

Ronald
Feb 11 '08 #4

harshmaul
Expert 100+
P: 490
Which is why i asked if 7effery was trying to rewrite, as oposed to offering the solution as rewritting.

Merly giving 7effery options.
Feb 11 '08 #5

ronverdonk
Expert 2.5K+
P: 4,258
Which is why i asked if 7effery was trying to rewrite, as oposed to offering the solution as rewritting.

Merly giving 7effery options.
Ok harshmaul, I understand. Sorry form any misunderstanding on my part.

Ronald
Feb 11 '08 #6

P: 12
Hi guys

i have fixet it, just wanna thank you for your help
Feb 11 '08 #7

ronverdonk
Expert 2.5K+
P: 4,258
Hi guys

i have fixet it, just wanna thank you for your help
You are most welcome.

Ronald
Feb 11 '08 #8

Post your reply

Sign in to post your reply or Sign up for a free account.