Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7761055
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T14:03:08+00:00 2026-06-01T14:03:08+00:00

<?php $activesidebar[$currentsidebar]=id=isactive;?> <div class=span3> <div class=well sidebar-nav hidden-phone> <ul class=nav nav-list> <li class=nav-header <?php

  • 0
<?php $activesidebar[$currentsidebar]="id=isactive";?>

<div class="span3">
<div class="well sidebar-nav hidden-phone">
<ul class="nav nav-list">                   
    <li class="nav-header" <?php echo $activesidebar[1] ?>>Marketing Services</li>
    <li><a href="#">Marketing Technology</a></li>
    <li><a href="#">Generate More Sales</a></li>
    <li><a href="#">Direct Email Marketing</a></li>

    <li class="nav-header" <?php echo $activesidebar[2] ?>>Advertising Services</li>
    <li><a href="../services-advertising-mass-media-network.php">Traditional Medias</a></li>
    <li><a href="#">Online & Social Medias</a></li>
    <li><a href="#">Media Planing & Purchasing</a></li>

    <li class="nav-header" <?php echo $activesidebar[3] ?>>Technology Services</li>
    <li><a href="#">Managed Websites</a></li>
    <li><a href="#">Managed Web Servers</a></li>
    <li><a href="#">Managed Databases</a></li>

    <li class="nav-header" <?php echo $activesidebar[4] ?>>About Us</li>
    <li><a href="../aboutus-contactus.php">Contact Us</a></li>
</ul>
</div>

This is added to the current page I want to add this on.

<?php $currentsidebar =2; include('module-sidebar-navigation.php');?>

I had programmed this menu individually on each page, but to make my website dynamic I used one file and use php includes to load the file. I can get the menu to highlight on the current page assigning an id=”isactive”, how can I assign id=”notactive” to the other 3 menu items that are not active on that page. Is there an else or elseif I have to include?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T14:03:08+00:00Added an answer on June 1, 2026 at 2:03 pm

    Reset the array before setting your preferred index.

    for ($i = 0; $i < 4; $i++) {
         $activesidebar[$i] = "class=\"noactive\"";
    }
    

    Notes:

    • PHP array indices start from 0, not 1.
    • ID’s are meant to be unique (ie, there cannot be 2 of the same ID). Use a classname instade.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

PHP/MySQLisolating database access in class - how to handle multiple row Selects Here’s a
PHP code: <a id=a$id onclick=check($id,1) href=javascript:void(0) class=black>Qualify</a> I want to remove the onclick=check($id,1) so
PHP Fatal error: Default value for parameters with a class type hint can only
PHP: <input type='checkbox' onChange='DoTheSwitch(1);'><div id='Hide1'>Hide</div> 1 <input type='checkbox' onChange='DoTheSwitch(2);'><div id='Hide2'>Hide</div> 2 <input type='checkbox' onChange='DoTheSwitch(3);'><div
PHP's list keyword is nice for taking out variables from an array $a as
Php code: class build { function panel() { $dummy=Lorem ipsum dolor sit amet, consectetur
PHP has a language construct list() which provides multiple variables assignment in one statement.
PHP functions such as 'array_map' take a callback, which can be a simple function
PHP version 5.3 has been released, and although it looks great, all my code
PHP uses magic quotes by default but has gotten a lot of flak for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.