如何使用多个命令创建一个导航

I am trying to build a navigation that determines the page the user in on and gives that link a different command to show a div tag if you click it on the current page. Example: you click on the home page to go to the home page. if you are on the home page and you click home again it causes a div tag to fade in. I have the div tag working but I don't know how to apply more than one command to an tag. I want the navigation to just be a sitewide include incase I have to make further updates to the site. Right now I have individual navigation on each page.

In PHP you can learn about the page that has been requested by using the value in $_SERVER['REQUEST_URI'] and related entries.

You can then take it to decide on which page you are and change the display of the menu according to the requested page.

This allows you to include the menu template from many different files regardless where inside your page structure these are located.

A short example, here with your suggested PHP_SELF entry and a non-directory structure:

<?php

    $currentPage = basename($_SERVER["PHP_SELF"]);

    /** define the menu **/
    $menu = array(
        array('index.php', 'home');
    );

    /** process the menu **/    
    foreach ($menu as &$entry) {
        list($page, $name) = $entry;
        $isCurrent = $currentPage === $page;
        if ($isCurrent) {                
            $href  = '#';
            $extra = ' onclick="MM_effectAppearFade(display, 2500, 0, 100, true)"';
        } else {
            $href  = $page;
            $extra = '';
        }
        $entry = array_merge($entry, array($href, $extra));
    }
    unset($entry);

    /** output the menu **/
?>
<ul>
    <?php foreach($menu as $entry) { ?>
        <li>
            <?php
                list($page, $name, $href, $extra) = $entry;
                printf(
                    '<a href="%s"%s>%s</a></li>', 
                    $href, $extra, htmlspecialchars($name)
                );
             ?>
        </li>
    <?php } ?>
</ul>

apply more than one command to an tag

I assume you are using onlick attributes in the element. Don't do that. Assign any event handler from a separate script. You can bind as much events to an element as you want (and also as much callbacks to an event as you want).

jQuery example:

jQuery( '#menu a' ).on( 'click', function( event ) {
    if( event.target.attr( 'href' ) == window.location ) {
        event.preventDefault();
        jQuery( '#specialDivPopup' ).show();
    }
} );

simply put a jquery hide div function on the onclick @ the same page (try a logic)

@ Home Page -> (PUT CODE TO HIDE HOME DIV ON CLICK)

@ MYPAGE Page -> (PUT CODE TO HIDE MYPAGE DIV ON CLICK)