php - How to include menu -
i'm trying include menu.php in many html files. followed instructions online, can't display menu
this menu file
<li><a href="index.php">home</a></li> <li><a href="about.php">about us</a></li> <li><a href="products.php">products</a></li> <li><a href="services.php">services</a></li> and how try include in files
<!doctype html> <html> <body> <?php include "includes/menu.php"; ?> // or <ul id="navigation"><?php include("includes/menu.php"); ?></ul> <p>some text.</p> </body> </html> something doesn't work either no menu bar or code written in file. not sure i'm doing wrong.
either way (with or without parenthesis) okay - make sure path correct -
if use require - it'll fire error, , if error reporting turned on, you'll able see full path trying include menu.php -
otherwise, rule of thumb include full path:
include "/absolute/path/to/includes/menu.php";
Comments
Post a Comment