Mikeneedshelp Posted August 2, 2015 Share Posted August 2, 2015 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 More sharing options...
Jonathon Posted August 2, 2015 Share Posted August 2, 2015 The header.html file is included in a php file. So the server sees a php file primarily and hence executes it as php. Link to comment Share on other sites More sharing options...
Mikeneedshelp Posted August 3, 2015 Author Share Posted August 3, 2015 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 More sharing options...
Larry Posted August 3, 2015 Share Posted August 3, 2015 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 More sharing options...
Mikeneedshelp Posted August 3, 2015 Author Share Posted August 3, 2015 That make total good sense but for some reason the drop down menus on the code above is not shown in the web site at all or through the server and its not my IDE as well. Link to comment Share on other sites More sharing options...
Larry Posted August 3, 2015 Share Posted August 3, 2015 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 More sharing options...
Mikeneedshelp Posted August 3, 2015 Author Share Posted August 3, 2015 Yes, When I am checking all pages I go through URL and I go directly to the page that I am working on. Thanks Larry. Link to comment Share on other sites More sharing options...
Larry Posted August 4, 2015 Share Posted August 4, 2015 What do you mean by "I go directly to the page that I am working on"? What URL are you viewing in your browser when you're seeing this (the header not creating the menus)? Link to comment Share on other sites More sharing options...
Recommended Posts