View Full Version : php question
TheRunes
January 3rd, 2001, 13:39
I was wondering if there is a way to use php to put a header on a website so I dont have to edit every page everytime I add a new page. I just edit a text file.
If there is a script already out there where can I find it?
Koolguy
January 3rd, 2001, 13:49
<?include('file.txt');?>
Woofcat
January 3rd, 2001, 13:58
<?require('file.txt')?>
A little more efficient :)
TheRunes
January 3rd, 2001, 14:45
so do i rename my html files to php?
jvv
January 3rd, 2001, 14:58
Yah, unless you have set it up in your that php also handles .html files.
TheRunes
January 5th, 2001, 13:35
What version browser would someone have to have to view the page correctly? Would Internet Exploder and Netscape 3.0 or older view it correctly?
megacool
January 5th, 2001, 14:27
PHP outputs the HTML so the browser basically understands HTML... So if the code ur php script generates is compatabile with the browsers it would work fine.
For example if ur php file outputs some IE supported stuff.. then it wont work in NS
RNilsson
January 5th, 2001, 14:48
I have sample code to share if you need.
Contact via e-mail: lstrike@hem.passagen.se or ICQ: 3941368
Nick
January 5th, 2001, 19:58
IMHO <?virtual("/include/top.inc")?> works better because it works on all directories. If include/require does to, I didn't know :p.
jw
January 6th, 2001, 12:40
the virtual function passes the file you are calling through apache first, adds it to the page, then passes through apache again, so it is inherently slower than include and require (the fastest). virtual is used for incluing cgi or perl scripts' output into the page.
Nick
January 6th, 2001, 12:46
Does require work out of the http root?
niekas
January 8th, 2001, 01:50
you can use .htaccess and configure your files to be included sitewide without changing actual files themselves as if the include() function has been used
php_value auto_prepend_file "/full_path_blah-blah/header.php3"
the same with auto_append_file "" would be parsed after the main file.
you can do a lot customization with .htaccess
TheRunes
January 8th, 2001, 10:41
I don't know how to use .htaccess... I just recently got hold of a unix shell acount to teach myself unix and it came with webspace. If you could point me to a good place to learn about .htaccess, I would be happy. I have wanted to learn and I cant find any good places...
Nick
January 8th, 2001, 17:53
Ok, well I'm off to go replace all of my Virtual commands with require :p. Thanks Guys :).
TheRunes
January 8th, 2001, 18:31
At least my question helped someone besides me. Glad it helped... Thanx guys for helping me as well... require is very handy... i am using it for more then headers and footers now...
Scott Hough
-------------------
http://www.the-runes.com
http://metmom----------
neon
January 9th, 2001, 12:37
To answer your .htaccess question try here it is pretty good for starters. http://www.echodev.com/tutorials/misc/htaccess/ Anyway good luck.
TheRunes
January 9th, 2001, 13:28
Thanx
Powered by vBulletin® Version 4.1.7 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.