Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Apr 2006
    Posts
    26
    Thanks
    0
    Thanked 0 Times in 0 Posts

    page name varaible

    Hello,
    My experience with php is only limited to 'includes' for headers and footers. For my header file, i want to add "id=active" if the page name equals to what is in the if statement. This is what if have so far:

    <li <?php if pageTitle == 'home.php' echo ('id="active"'); ?>><a href="home.php">Home</a></li>

    1. Did i nest the php properly?
    2. What is the name of the variable for the page name?
    3. Should I use echo or print?
    4. Will this work?

    Thank you,
    Michelle

  • #2
    New Coder
    Join Date
    Apr 2006
    Posts
    26
    Thanks
    0
    Thanked 0 Times in 0 Posts
    nevermind - i figured it out
    thanks anyways


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •