Page 1 of 1

Need help on PHP, HTML and CSS debugging

Posted: Tue Sep 29, 2009 10:38 pm
by mtingson
Hi guys,

I'm having a hard time debugging my project. I am starting to create my new Content Management System. I'm stuck on debugging my navigation menu. Here's the thing, I have 4 items on my menus (Home, Samples, Contact Us, and Links). Samples and Links menu has a corresponding sub-menu. What I want to happen is that, if I click either 4 menus, the font of each menu should be "bold". But what is happening is that, even the sub-menus under Sample and Links are "bold". Is there something wrong with my PHP, HTML or CSS?

Here are some of my code:
--PHP and HTML

Code: Select all

 
  <?php
    if (isset($_GET['menu'])){
        $sel_page = "";
        $sel_menu = $_GET['menu'];
        
    } elseif (isset($_GET['page'])){
         $sel_menu = "";
         $sel_page = $_GET['page']; 
    } else{
        $sel_menu = "";
        $sel_page = "";
    }
?>
<table id="structure">
            <tr>
                <td id="navigation">
                    <ul class="subjects">
                        <?php
                            $menu_set = get_all_menus();
                            while($menu = mysql_fetch_array($menu_set)){
                                echo "<li";
                                    if($menu["id"] == $sel_menu){
                                       echo " class=\"selected\""; // [color=#BF0000]HERE'S is my condition that makes the font bold[/color]
                                    }
                                    echo "><a href=\"content.php?menu=" . urlencode($menu["id"]) . "\">{$menu["menu_name"]}</a></li>";
                                $page_set = get_pages_for_menu($menu["id"]);
                                echo "<ul class=\"pages\">";
                                    while($page = mysql_fetch_array($page_set)){
                                        echo "<li";
                                        if($page["id"] == $sel_page){
                                            echo " class=\"selected\""; // [color=#FF0000]HERE'S is my condition that makes the font bold[/color]
                                        }
                                        echo "><a href=\"content.php?page=" . urlencode($page["id"]) . "\">{$page["page_name"]}</a></li>";
                                    }
                                echo "</ul>";
                            }
                        ?>
                    </ul>
                </td>
                <td id="page">
                    <h2>Content Area</h2>
                    <?php echo $sel_page; ?><br/>
                    <?php echo $sel_menu; ?><br/>
                </td>
            </tr>
        </table>


Here's my CSS for setting "selected" class to bold.
--CSS

Code: Select all

.selected {
    font-weight: bold;
}


I am using <table><td><tr><li> and <ul> tags on this.

Please advise.

Thanks!

Re: Need help on PHP, HTML and CSS debugging

Posted: Tue Sep 29, 2009 11:47 pm
by mtingson
Oh man!

It's just a browser issue because I'm testing it on IE 6. When I try to test in Firefox 3.5 everything looks perfect.

Very very weird. Now I learned something.

Hopefully this would help others too.