-1

I have two PHP scripts:

  • header.php
  • contact_us.php

In Index.php when the user clicks the menu, it smoothly slides down. But for the "Contact Us" page I don't want that behavior; because it is so simple, containing only a link, I just want it to come up quickly and remain until the home link is clicked in the menu.

<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
     <?php
        if(basename($_SERVER['SCRIPT_FILENAME']) == 'index.php'){
     ?>
        <nav>
            <ul class="nav navbar-nav">
                <li><a href="#" class="active">Home </a> </li>
                <li><a href="#services">Services</a> </li>
                <li><a href="#search">Search For Homes</a> </li>
                <li><a href="#recent">Recent Transacctions</a></li>
            </ul>
        </nav>
        <?php                               
            }else{
        ?>
        <nav>
            <ul class="nav navbar-nav">
                <li><a href="index.php" class="active">Home </a> </li>
                <li><a href="service.php">Services</a> </li>
                <li><a href="search.php">Search For Homes</a> </li>
                <li><a href="recent.php">Recent Transacctions</a></li>
            </ul>

        </nav>
        <?php                               
            }
        ?>
    </div>
clearlight
  • 12,255
  • 11
  • 57
  • 75
Abdur
  • 27
  • 6
  • http://stackoverflow.com/a/9805747/4050077. Please check this out – ash__939 Jan 07 '17 at 05:05
  • I tried to clear it up by editing but it is an *extremely* confusing question with too many bold characters. Remember 'shouting' does not make the question clearer. If you think I misinterpreted it, please edit and roll back my changes, otherwise, just edit it and clarify it from here. Maybe you can use Google Translate or get someone's help to translate it into a clear question. My guess is that you haven't shown enough code or provided enough context to get the help you need. – clearlight Jan 11 '17 at 04:06

1 Answers1

0

For else condition when you are on contact-us page.

Change URL as below:

<nav>
    <ul class="nav navbar-nav">
        <li><a href="index.php" class="active">Home </a> </li>
        <li><a href="index.php#services">Services</a> </li>
        <li><a href="index.php#search">Search For Homes</a> </li>
        <li><a href="index.php#recent">Recent Transacctions</a></li>
    </ul>
</nav>
Anil Singh
  • 11
  • 3