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..

2 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
  2. Your posts are really helpful. But please keep posting more entries in your blog!

    Tattoo Machine Kit

    ReplyDelete