Saturday, August 7, 2010

get the current page name without full domain

Use:

//function curPageName() {
return substr($_SERVER["SCRIPT_NAME"],strrpos($_SERVER["SCRIPT_NAME"],"/")+1);
}

echo "This page name is ".curPageName();
?>//

This will give you just page.html etc..

1 comments:

  1. This post is interesting and I think helpful as well. I will refer this to my friend. Thank you and keep sharing.

    web design manila

    ReplyDelete