Get Page Title/Name etc

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
fastfingertips
Forum Contributor
Posts: 242
Joined: Sun Dec 28, 2003 1:40 am
Contact:

Get Page Title/Name etc

Post by fastfingertips »

I want to store in my database the page name that generated the error, that's why can you tell me if is there any way to extract some info about the current page?
User avatar
CoderGoblin
DevNet Resident
Posts: 1425
Joined: Tue Mar 16, 2004 10:03 am
Location: Aachen, Germany

Post by CoderGoblin »

Although not specifically Page name/Title you could use __FILE__ which tells you the current filename. Normally I use basename(__FILE__) for debug purposes.

Regards
malcolmboston
DevNet Resident
Posts: 1826
Joined: Tue Nov 18, 2003 1:09 pm
Location: Middlesbrough, UK

Post by malcolmboston »

Code: Select all

$_SERVER['PHP_SELF']
// will give you the currently executing script
i usually use this method
Post Reply