Reputation:
I am trying to include a header and footer dynamically with an url like this:
<?php include("http://www.monsite.com/layout/header.html"); ?>
but it doesn't work.
Anybody can help me ?
Thanks you.
Upvotes: 1
Views: 1150
Reputation: 231
Make sure that the path you added in include function is correct.I think you are doing mistake in path of header file.
<?php include("root/path/layout/header.html"); ?>
Upvotes: 0
Reputation: 219794
include()
expects a physical path on the file server, not a URL.
Files are included based on the file path given or, if none is given, the include_path specified. If the file isn't found in the include_path, include will finally check in the calling script's own directory and the current working directory before failing.
<?php include("/root/path/to/layout/header.html"); ?>
Upvotes: 3