Jump to content

Headers


ari_aaron

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?
Link to comment
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.
Link to comment
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]
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.