|
sweyhrich
|
 |
« on: February 17, 2003, 10:07:00 PM » |
|
I have pages that all have the same headers and footers, and some have similar navigation buttons. Rather than have each page a repeition of this template, and have to update all the pages when the headers and footers change, I would like to have a way to use EXTERNAL html code in a web page.
Would the FRAME, ILAYER, or OBJECT tags allow this? Which is the better choice? Info I can find about OBJECT suggests that it is primarily for pictures or applets, but I can't see how it could be used for HTML code.
|
|
|
|
|
Logged
|
|
|
|
|
stephan
Guest
|
 |
« Reply #1 on: February 18, 2003, 03:50:00 AM » |
|
If you rename your page to .php from .htm or .html as it is already, you can use a PHP command to include the header and footer wherever you want. code:
<? include ("Yourfile.html"); ?>
Just put that in, and it will include the html file in your page.
Just remember to call your main page something.php, instead of something.htm, where "something" can be whatever you want.
|
|
|
|
|
Logged
|
|
|
|
|
Ed
|
 |
« Reply #2 on: March 09, 2003, 06:54:00 AM » |
|
On that topic,is there any way to change the extensions so that say, a .html page would be auto parsed as .shtml? or .html would be parsed for .php in certain directories? Are we allowed to edit the .htaccess files to enable this, or are those parsing rules set in stone? - Ed (A very potential customer) http://www.jokeawhenever.com
|
|
|
|
|
Logged
|
|
|
|
|
esm
|
 |
« Reply #3 on: March 11, 2003, 11:45:00 AM » |
|
here is what I did and I assume you can do the same... In your control panel click on the Apache Handles. 1. In the Extention(s) box, enter .html 2. In the Handler box, enter server-parsed 3. Click the add option. you could do the same thing by entering code:
AddType text/x-server-parsed-html .html
in your .htaccess file but I'd use the control panel.
Now in you html files you can enter something like:
<!--#include virtual="/css.txt" -->
or
<!--#include virtual="/menu.html" -->
you'll need to use the html file extension if you have other ssi calls in the menu (or whatever)file.
|
|
|
|
|
Logged
|
Gene The older I get, the more I admire competence, just simple competence, in anything from adultery to zoology
|
|
|
|
|
|
stephan
Guest
|
 |
« Reply #5 on: March 19, 2003, 04:19:00 PM » |
|
No problem!
It will only work online.
PHP is a scripting programming language. It only works when it's run by the server.
I normally make a file called test.php and put in a directory to test it out.
|
|
|
|
|
Logged
|
|
|
|
|
Boris
|
 |
« Reply #6 on: March 20, 2003, 12:54:00 AM » |
|
Well you can always install apache on your computer and use php and mysql to test it Here's a few links if you are tempted to do it: EasyServ Php triad devphp FoxServ PHP everywhere They're fairly easy to install and work wonders in testing a site before sending it online live (uh for me. because i dont have broadband, and well..Uploading all the files to find out i missed a line somewhere in my coding..is..pretty nerve wracking !["" "[Smile]"]("smile.gif") ) hope that helps!
|
|
|
|
|
Logged
|
Questions on graphics? Visit the lunarpages Graphics forum!
Bugging Danielle daily since 2003.
Have a Lunar Day!
|
|
|
|
stephan
Guest
|
 |
« Reply #7 on: March 20, 2003, 01:21:00 AM » |
|
Last time I installed phptriad on a linux computer, it had a massive security problem. Make sure you get the latest, most up to date version. omnicron httpd is a very easy to set up webserver for windows, it includes PHP. www.omnicron.caI just test my scripts online now, I'm too lazy to test them at home!
|
|
|
|
|
Logged
|
|
|
|
|
KJones
|
 |
« Reply #8 on: March 20, 2003, 03:46:00 AM » |
|
I'm not ready to attempt that... not yet. I've got a cable modem, so it's not that big a problem (I'm always online)... it's just a pain in the butt to have FTP my page every time I want to see it. Only the header and side menu are added using PHP, so they're the only parts that don't show up offline... so I can learn to live with that I guess. This will make things a lot easier... I've got 90+ pages all with the same header and side menu. Kel
|
|
|
|
|
Logged
|
"I believe that this nation should commit itself to achieving the goal, before this decade is out, of landing a man on the moon and returning him safely to the earth." - John F. Kennedy
|
|
|
|
stephan
Guest
|
 |
« Reply #9 on: March 20, 2003, 09:00:00 AM » |
|
Yeah, maybe later Setting up a server can lead to a lot of security problems.
|
|
|
|
|
Logged
|
|
|
|
|
KJones
|
 |
« Reply #10 on: March 21, 2003, 02:51:00 AM » |
|
One more question... Doesn't the server automatically look for a certain file name for the main page of the website (ie. index.htm)? If I name the main page index.php will visitors be automaitically directed to that page? Oops... I guess that was two questions. !["" "[Smile]"]("smile.gif")
|
|
|
|
|
Logged
|
"I believe that this nation should commit itself to achieving the goal, before this decade is out, of landing a man on the moon and returning him safely to the earth." - John F. Kennedy
|
|
|
|
amy
|
 |
« Reply #11 on: March 21, 2003, 04:15:00 PM » |
|
For html pages you need to name the page index.html or index.htm and for asp pages either index.asp or default.asp and for php it's index also. Yes our servers are looking for a page called index !["" "[Smile]"]("smile.gif")
|
|
|
|
|
Logged
|
--Amy Armitage Lunarpages.com
|
|
|
|