Home » Php » html – Change position of Echo in PHP

html – Change position of Echo in PHP

Posted by: admin February 25, 2020 Leave a comment

Questions:

I have a Main1.html file where i call this code

<?php $variable = "1"; 
 include('index.php');  ?>

I have a Main2.html file where i call this code

<?php $variable = "2"; 
 include('index.php');  ?>

Inside index.php

<?php

  if ($variable == '1') {
   //Some Code
  }

I have menu inside index.html. I have around 10 Main Html files where the item selected in the menu will be different for all classes.

These are the normal and active items

    <a href="Excel.html" >C++</a>
    <a class="active" href="Word.html">C++</a>

Inside index.php i want to use IF STATEMENT to put the code class=”active” in the respective menu item. Is this possible?

How to&Answers: