Jump to content

Archived

This topic is now archived and is closed to further replies.

ari_aaron

Headers

Recommended Posts

how can I make HTML code from 1 file go into every one.
I need something like:

[code]
<html>
<head>
<title>Home</title>
</head>
<header.html>
<!---page content>
<footer.html>
</html>[/code]


also, it there a way to open tags in the other files, and close them in this file?

Share this post


Link to post
Share on other sites
Use html includes - you don't need php at all. Excellent tutorial at [a href=\"http://bignosebird.com/ssi.shtml\" target=\"_blank\"]http://bignosebird.com/ssi.shtml[/a]

Share this post


Link to post
Share on other sites
If your server has PHP installed on it, you can use the auto_prepend_file and auto_append_file directives in .htaccess. Just put the top half (everything above the body content) in the auto_prepend_file directive, and everything below the body content in the auto_append_file directive. It'll automatically put the contents of those files at the top and bottom, respectively, of all PHP scripts.

Share this post


Link to post
Share on other sites
The HTML inludes don't work on .php files. only .shtml

auto_prepend_file and auto_append_file arn't good because the title is diffrent on each page.

Share this post


Link to post
Share on other sites
[!--quoteo(post=372102:date=May 7 2006, 04:10 PM:name=ari_aaron)--][div class=\'quotetop\']QUOTE(ari_aaron @ May 7 2006, 04:10 PM) [snapback]372102[/snapback][/div][div class=\'quotemain\'][!--quotec--]
The HTML inludes don't work on .php files. only .shtml[/quote]
If you had mentioned that ...

Then use php includes: example

[code]
<html>
<head>
<title>Home</title>
</head>
<?php include("header.html"); ?>
<!---page content>
<?php include("footer.html"); ?>
</html>[/code]

Share this post


Link to post
Share on other sites
this is a php forum....


anyway, thank you, that is what I needed.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.