Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    Regular Coder
    Join Date
    Apr 2007
    Posts
    317
    Thanks
    24
    Thanked 3 Times in 3 Posts

    Navigation does not Display on Webpage

    I'm having a problem with my navigation not displaying on my webpage. It's weird because when it doesn't display and you view source on the page, the code is present in the page. If you take your mouse and highlight over the area nothing select as if it's not there. I was thinking maybe the text just showed up white and i couldn't see it, but no it's just not displaying. Every time i refresh the page the navigation will show up. I don't want to have to refresh the page everytime i login. HELP! PLEASE!

    This is what i have in my include file for the nav.
    PHP Code:
    //session_start();
    //session_name('polv_id');
    echo '<DIV id=leftcol>';
    echo 
    '<UL id=nav>';
    //if(isset($_SESSION['username']))  {
    echo '<LI><a href="./main.php">Main</a></LI>';
    echo 
    '<LI><A href="./add_job.php">Add Job</A></LI>';
    echo 
    '<LI><A href="./edit_job.php">Edit Job</A></LI>';
    echo 
    '<LI><A href="./add_rfi.php">Add RFI</A></LI>';
    echo 
    '<LI><A href="./add_note.php">Add Note</A></LI>';
    echo 
    '<LI><A href="./installation.php">Installation</A></LI>';
    echo 
    '<LI><A href="./punch_list.php">Punch Lists</A></LI>';
    echo 
    '<LI><A href="./users.php">Users</A></LI>';
    //}
    echo '</UL>';
    echo 
    '</DIV>'
    Thanks for the help in advance.

  • #2
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,495
    Thanks
    8
    Thanked 1,089 Times in 1,080 Posts
    Do you have an actual URL we can test?
    I'm thinking it might be a browser issue and we can test FF, IE, safari, etc.

  • #3
    Regular Coder
    Join Date
    Oct 2005
    Location
    Right Here
    Posts
    654
    Thanks
    1
    Thanked 0 Times in 0 Posts
    You must use dreamweaver or something... I can't stand caps in code and its lazily done. <div id="leftcol"> For example.

    But to the question at hand. That's how your code looks right now? With the commented $_SESSION? As when you said you have to refresh the page to get the nav to show up, it seems your username variable wasn't being set into the session until that page, and then you had to refresh for the action to take place. But if its commented and you have NO OTHER code involved above or below, then I would say it should work. BUT Im guessing you have other code involved that is preventing this to be displayed on initial load. You have to be setting something or wrapping it some how.

    CSS troubles?

  • #4
    Regular Coder
    Join Date
    Apr 2007
    Posts
    317
    Thanks
    24
    Thanked 3 Times in 3 Posts
    I commented the session stuff out in my attempt to trouble shoot why this is happening. I thought maybe it was a session issue, but with it commented out there is no other excuse. Here is my header that is called right before the leftcol is included.

    PHP Code:
    <DIV id=header>
    <DIV id="toplogo"><img src="./images/polv-logo.jpg"  /></div>
    <?php
    if(isset($_SESSION['username'])) { 
    $username $_SESSION['username'];
    echo 
    '<UL id=topnav>';
    echo 
    '<LI class=sitemap><p>Hello ' $username' you are logged in!</p></LI>';
    echo 
    '<LI class=sitemap><A href="./logout.php">Logout</A></LI>';
    echo 
    '</UL>';
    }
    ?>
    </DIV> <!--End of Header -->
    The header code works all of the time with no problems.

  • #5
    Regular Coder
    Join Date
    Oct 2005
    Location
    Right Here
    Posts
    654
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Well troubleshoot it... Remove your css file. Remove all data from the page except the nav. Keep removing and adding back until you find the code that is causing it. Best way to learn is to do.

  • #6
    Regular Coder
    Join Date
    Apr 2007
    Posts
    317
    Thanks
    24
    Thanked 3 Times in 3 Posts
    In case anyone else has this problem...

    I fixed it within my css. I simply had to set the width parameter and the text showed up. I guess it was running off the page somehow and becoming invisible.

  • #7
    Senior Coder ahallicks's Avatar
    Join Date
    May 2006
    Location
    Lancaster, UK
    Posts
    1,134
    Thanks
    1
    Thanked 57 Times in 55 Posts
    I'd also get into the practice of using " around class and id names because that will have some implications on browser problems
    "write it for FireFox then hack it for IE."
    Quote Originally Posted by Mhtml View Post
    Domains are like women - all the good ones are taken unless you want one from some foreign country.
    Reputation is your friend

    Development & SEO Tools


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •