Blog

Newest Post
Blog Archives
Blog Categories

Portfolio

3D Models
Banners
Brochures
Business Cards
Custom Programming
Environments
Flash Projects
Game Design
Image Altering
Web Design

About

Resume
Recommendation Letters

Contact

November 22, 2007

Get Page Name from Web Address using PHP

Filed under: PHP — admin @ 12:55 pm

This syntax is useful for dynamically creating web pages. For example with PHP you can recognize the page you are on and then display a proper header for that page.

i.e. let’s say the weblink is “www.page.com/form.php”

$page_name =  basename($_SERVER['PHP_SELF'],".php");

The “$page_name” would equal “form” for the .php was dropped.

Leave a Reply

© - Digital Epiphany Designs, Online Portfolio for Web Design, Custom Programming, Grapic Design and Game Design.