Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
PHP function to display current page name?
Old 02-10-2006, 03:56 PM PHP function to display current page name?
hiptobesquare's Avatar
Extreme Talker

Posts: 186
Location: London UK
Trades: 0
Hi.

I know that $HTTP_SERVER_VARS['HTTP_REFERER'] will return a user to the previous page viewed, but is there a php function which will output the name of the current page?

I want to create a page which contains all my link buttons and then include it into every page on the site - so if i need to add more buttons i only have to modify 1 page. However, i want the button of the selected page to be highlighted and i cant figure out how to do this if every page on the site refers to an included piece of code to display my buttons.

Anybody know?

Thankyou
hiptobesquare is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 02-10-2006, 04:27 PM Re: PHP function to display current page name?
stoot98's Avatar
Ultra Talker

Posts: 427
Name: Stuart
Location: Glasgow, Scotland
Trades: 0
PHP Code:
$_SERVER['SCRIPT_FILENAME'
That will get the whole URL which you can manipulate until your hearts content. There's probably better ways, and that one is most likely flawed but it seems to work not too bad...

Stoot
stoot98 is offline
Reply With Quote
View Public Profile
 
Old 02-10-2006, 04:30 PM Re: PHP function to display current page name?
hiptobesquare's Avatar
Extreme Talker

Posts: 186
Location: London UK
Trades: 0
Excelllent. just what im looking for. Thanks
hiptobesquare is offline
Reply With Quote
View Public Profile
 
Old 02-10-2006, 04:32 PM Re: PHP function to display current page name?
dahak's Avatar
Skilled Talker

Posts: 60
Location: Romania
Trades: 0
i am sure that this isnt the best and smart way to do this,but i`ve done something like this for a footer on a page :
created a $footer var that i included in the config.php page
PHP Code:
$footer "<td colspan=\"11\" bgcolor=\"#84987D\" class=\"gruppi\" align=\"center\" valign=\"middle\"><a href=\"../../index.php\">|&nbsp;&nbsp;Home</a> <a href=\"../htm/chi_siamo.html?menu=item_1\">|&nbsp;&nbsp;Profilo</a> <a href=\"gruppi.php?dest=TUTTE&action=nextpage&id=1&menu=item_2\">|&nbsp;&nbsp;Gruppi</a> <a href=\"individuali.php\">|&nbsp;&nbsp;Individuali</a> <a href=\"offerte.php?action=nextpage&id=1\">|&nbsp;&nbsp;Offerte Speciali</a> <a href=\"../htm/ambasciate.html?menu=item_3\">|&nbsp;&nbsp;Viaggiare Informati</a> <a href=\"#\">|&nbsp;&nbsp;Area Agenzie&nbsp;&nbsp;|</a> </td>"
after you do this you can add a variable in the url of each page and use $_GET[''] to display the name of each page...
if i want to modify anything to the footer i just go to the config.php file and modify the $footer variable...
dahak is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to PHP function to display current page name?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.15434 seconds with 12 queries