1
votes

// start get page name //end

  • class="active" href="index.php"> Home
  • class="active" href="login.php">Login
  • class="active" >Faq
  • class="active" href="contact.php">Contact
  • !-- static menu here below --> Contact
    1
    How tell how you are defining $pagename ?Chirag Chhuchha
    i am getting pagename in the $pagename variableHari
    I'm asking for the method from which you are getting page name.Chirag Chhuchha
    $page = $_SERVER['REQUEST_URI']; $pagename = str_replace('/linkweb-master/'," ",$page);Hari

    1 Answers

    0
    votes

    You are replacing /project/ with a space and this will output filename like " index.php" with a preceding space.

    $pagename = str_replace('/project/'," ",$page);
    

    you need to replace it without any space like

    $pagename = str_replace('/project/',"",$page); 
    

    this will output filename without space.