Jump to content
Larry Ullman's Book Forums

Recommended Posts

In the header.html why is there PHP? What makes the PHP work?

 

The dropdown menus are not working in the header.html on page 69.

 

// Show basic user options:

// Includes references to some bonus material discussed in Part Four!

echo '<li class="dropdown">

<a href="#" class="dropdown-toggle" data-toggle="dropdown">Account <b class="caret"></b></a>

<ul class="dropdown-menu">

<li><a href="logout.php">Logout</a></li>

<li><a href="renew.php">Renew</a></li>

<li><a href="change_password.php">Change Password</a></li>

<li><a href="favorites.php">Favorites</a></li>

<li><a href="recommendations.php">Recommendations</a></li>

</ul>

</li>';

 

// Show admin options, if appropriate:

if (isset($_SESSION['user_admin])) {

echo '<li class="dropdown">

<a href="#" class="dropdown-toggle" data-toggle="dropdown">Admin <b class="caret"></b></a>

<ul class="dropdown-menu">

<li><a href="add_page.php">Add Page</a></li>

<li><a href="add_pdf.php">Add PDF</a></li>

<li><a href="#">Something else here</a></li>

</ul>

</li>';

}

 

I read in a forum that html does not recognize html in the server. What should I do? 

Link to comment
Share on other sites

The header.html file is included in a php file. So the server sees a php file primarily and hence executes it as php.

On page 66, it reads that a person needs to receive the code on template.html. Then continuing on with adding new code in the next few pages. In all that information, It reads nowhere what you just quoted me on this forum.

 

I really appreciate your help Mr. Jonathan.

Link to comment
Share on other sites

The e-commerce book does assume basic familiarity with PHP and MySQL, and how PHP works with includes would be in that category. In short, the end result of an included file is it's as if the code in the included file were part of the file including it. 

Link to comment
Share on other sites

The most basic debugging step would be to make sure you're always running the site through a URL, not through a file system. Also, to be clear, you're loading the PHP pages directly (e.g., index.php), not the header file, right?

Link to comment
Share on other sites

 Share

×
×
  • Create New...