Jump to content

template menu problem


pepelepew1962

Recommended Posts

Hello:

I am trying to create templates for my files and I am having a problem with getting the menu to work properly.  I have 3 template files, head.php, main.php and foot.php.  The head.php contains the following menu html:

   <li><a href="page1.php" class="<?php echo "$head001";?>">One</a></li>
   <li><a href="page2.php" class="<?php echo "$head002";?>">Two</a></li>
   <li><a href="page3.php" class="<?php echo "$head003";?>">Three</a></li>
   <li><a href="page4.php" class=<?php echo "$head004";?>>Four</a></li>
   <li><a href="page5.php" class="<?php echo "$head005";?>">Five</a></li>

In the main.php, I would like to have 1 variable for what the status of the menu is for that page.  For example when the person is on page 3, the class should be current.
 
$head003 = "Current";
include("head.php");

The variable current is in my external css file and changes the appearance.  Simple, but for some reason, the variable is not being carrier over.  Can you please help.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.