Html: Difference between revisions
Jump to navigation
Jump to search
Line 17: | Line 17: | ||
<?php include("http://www.othersite.com/filename.html"); ?> |
<?php include("http://www.othersite.com/filename.html"); ?> |
||
</source> |
</source> |
||
== Tips and Pits == |
|||
;Set charset specification in the first 1024 bytes! |
|||
* <code>http://stackoverflow.com/questions/19817459/firefox-font-face-with-local-file-downloadable-font-download-failed</code> in HEAD tag must come soon enough. |
|||
<pre> |
|||
The page was reloaded, because the character encoding declaration of the HTML document was not found when prescanning the first 1024 bytes of the file. The encoding declaration needs to be moved to be within the first 1024 bytes of the file. |
|||
</pre> |
Revision as of 14:47, 16 January 2016
References
Include another file
- Using server-side include
- If it doesn't work, TRY NAMING THE FILE WITH A .shtml EXTENSION!
- In Apache, SSI (include module) must be enabled.
<!--#include file="insertthisfile.html" -->
<!--#include virtual="insertthisurl_cgi.html" -->
- Using server-side include - PHP
- We can also use PHP, if the server is configured for it:
<?php include("filename.html"); ?>
<?php include("http://www.othersite.com/filename.html"); ?>
Tips and Pits
- Set charset specification in the first 1024 bytes!
http://stackoverflow.com/questions/19817459/firefox-font-face-with-local-file-downloadable-font-download-failed
in HEAD tag must come soon enough.
The page was reloaded, because the character encoding declaration of the HTML document was not found when prescanning the first 1024 bytes of the file. The encoding declaration needs to be moved to be within the first 1024 bytes of the file.