Get current page name in php


/ Published in: PHP



Copy this code and paste it in your HTML
  1. <?php
  2. $currentFile = $_SERVER["PHP_SELF"];
  3. $parts = Explode('/', $currentFile);
  4. echo $parts[count($parts) - 1];
  5. ?>

URL: http://www.scriptygoddess.com/archives/2007/07/13/use-php-to-get-the-current-pagefile-name/

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.