Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

General Discussion

Im in a jam with my php code. Please Help!!

I created my website on my local server and then I uploaded it to my hosted server. Some of the information will not show up in the on my hosted server but works perfectly on my local server. I don't understand why this would be.

Login.php

<div class="collapse navbar-collapse"> 
    <ul class="nav navbar-nav navbar-right">
    <li><a class="navbar-link" href="login.php">Login</a></li>
    <li><a class="navbar-link" class="navbar-link"class="navbar-link" href="register.php">Register</a></li>
    <li><a class="navbar-link" class="navbar-link" href="recover.php?mode=username">Forgot Username</a></li>
    <li><a class="navbar-link" href="recover.php?mode=password">Forgot Password</a></li>
</div>

loggedin.php

<div class="navbar-text navbar-right"> Welcome, <?php echo $user_data['username']; ?> 
    <a href="logout.php" class="btn btn-primary nav-right-a" role="button">Log out</a>
    <a href="changepassword.php" class="btn btn-primary nav-right-a" role="button">Change Password</a>  
    <a href="settings.php" class="btn btn-primary nav-right-a" role="button">Settings</a> 
    <a href="<?php echo $user_data['username']; ?>" class="btn btn-primary nav-right-a" role="button">Profile</a>

</div>

Then all this gets include into navlogin.php

<?php
if (logged_in() === true) {
    include '/includes/widgets/loggedin.php';
} else {
    include '/includes/widgets/login.php';
}
?>

Then this gets included in to the header.php

<header>
    <nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
      <div class="container">
        <!-- Brand and toggle get grouped for better mobile display -->
        <div class="navbar-header">
          <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>
          <a title="" class="navbar-brand " href="index.php">
            <img src="img/BGU Logo.png" />
            </a>
        </div>

        <!-- Collect the nav links, forms, and other content for toggling -->
        <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
          <ul class="nav navbar-nav">
            <li class="active"><a href="index.php">Home</a></li>
            <li><a href="#">Recrutment</a></li>
            <li><a href="servers.php">Servers</a></li>
            <li><a href="forums.php">Forums</a></li>
            <li><a href="contactus.php">Contact Us</a></li>
          </ul>
          <ul class="nav navbar-right">
            <?php include 'navlogin.php'; ?>
          </ul>
        </div><!-- /.navbar-collapse -->
      </div><!-- /.container-->
    </nav>
</header>

Then this gets included into my overall/header.php

<DOCTYPE html>
<html>
<?php
include 'includes/head.php';
?>

<body>
    <?php
    include 'includes/header.php';
    ?> 

then that is included into my index.php

<?php 
include 'core/init.php'; 
include 'includes/overall/header.php'; 

?>

2 Answers

Peter Mumford
Peter Mumford
7,774 Points

what doesn't show up?

The navlogin.php , it work right on my local server. just not on the live setting