Include the content from other webpages: Difference between revisions
Jump to navigation
Jump to search
| Line 23: | Line 23: | ||
== PHP require / include function == | == PHP require / include function == | ||
{{Acronym | acronym=PHP | def=Hypertext Preprocessor}} [http://tw.php.net/require_once require_once()], [http://php.net/manual/en/function.include.php include function] ... | {{Acronym | acronym=PHP | def=Hypertext Preprocessor}} [http://tw.php.net/require_once require_once()], [http://php.net/manual/en/function.include.php include function] ... | ||
'''troubleshooting:''' | |||
* (When I browsed some_file.php which include )Warning: include_once(lib.php) [function.include-once]: failed to open stream: No such file or directory in ...common/view.php | |||
<pre> | |||
common/lib.php | |||
common/view.php //the file included common/lib.php | |||
some_file.php //the file included common/view.php | |||
</pre> | |||
* solution: Using CONSTANT parameter (such as absolute file path in common configuration file) in the included path NOT using relative path | |||
== wiki softwares == | == wiki softwares == | ||
Revision as of 15:51, 8 June 2011
usage
- seperate the navigation and content into two parts
- compare the content from two webpages
approach
frame or iframe
- frame or iframe tag, object tag
- 缺點是瀏覽器上的鏈結,非該篇網頁的靜態鏈結。
- cross frame layers
Apache
javascript
- general (JavaScript Tip: Page Headers And Footers)
<script language="JavaScript" type="text/javascript" src="path/to.js"></script> <noscript><a href="URL">Description</a><noscript>
PHP require / include function
PHP require_once(), include function ...
troubleshooting:
- (When I browsed some_file.php which include )Warning: include_once(lib.php) [function.include-once]: failed to open stream: No such file or directory in ...common/view.php
common/lib.php common/view.php //the file included common/lib.php some_file.php //the file included common/view.php
- solution: Using CONSTANT parameter (such as absolute file path in common configuration file) in the included path NOT using relative path
wiki softwares
- DokuWiki export
- Mediawiki: MediaWiki Template or transclude syntax(Mediawiki formatting rules)
- Oddmuse wiki: Transclusion means to include a wiki page from elsewhere into your current page
other software
other software
- MovableType: template modules, or MultiBlog plugin
further reading
- Boutell.Com, Inc. (2007). How Do I Include One HTML File in Another? / Jennifer Kyrnin (n.d.). [2]