header
 
     
 
pixel
pixel pixel

Generate current page name

If you want to generate the current webpage's filename, you find it via the basename function and calling the $PHP_SELF environment variable:
echo basename($PHP_SELF);
This can be useful if you want a HTML form to post to itself, for example:
echo "<form name='form1' method='post' action='".basename($PHP_SELF)."'>";

Unhelpful Helpful Rating 3.9 (score out of 5, no. of ratings: 33)
Comments
Comment by whoop on 2005-08-20
just what i neded to create a dynamiv tabs script to work out which tab was active when the tabs run in a seporate heade include

Comment by sanjay on 2005-09-23
echo basename($PHP_SELF); echo "

";

Post a Comment
Name
Email
(optional)
Comment
RatingUnhelpful Helpful
Security Image* (this is just to prevent spam submissions)
Security Image