SitePoint Sponsor |
|
User Tag List
Results 1 to 25 of 25
Thread: Placing A Header On All Pages
-
Apr 6, 2005, 12:06 #1
- Join Date
- Jan 2005
- Location
- England (London Essex)
- Posts
- 0
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Placing A Header On All Pages
Hello Eveyone,
im starting a new free webhosting company - www.vensions.com
i would like to know how i can place a header on all html pages of the server (for advertising).
if this requires any custom coding i am willing to pay
Thanks, LW.
-
Apr 6, 2005, 12:11 #2
- Join Date
- Mar 2003
- Location
- England, UK
- Posts
- 2,906
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Hey LW, this probably isn't the best place to ask this question. Seems as PHP is on most webservers nowadays and it's an easy task accomplished in PHP, it would be best asked there. I've reported your post to be moved so I shall expect it'll be there soon
Good luck!
-
Apr 6, 2005, 12:28 #3
- Join Date
- Jan 2005
- Location
- England (London Essex)
- Posts
- 0
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
i dont think php will solve my problems, im giving away free hosting accounts with cpanel etc... i want to be able to create a header for all hosted accounts on the server. im shore its apache that needs to be modified to do this
Last edited by LittleWebmaster; Apr 6, 2005 at 13:02.
-
Apr 6, 2005, 17:12 #4
- Join Date
- Feb 2002
- Location
- Auckland
- Posts
- 14,692
- Mentioned
- 20 Post(s)
- Tagged
- 3 Thread(s)
Little,
I've just completed going through the httpd.conf file looking for anything that would suggest an autp_prepend feature - to no avail.
Ergo, I think that DeanC's reply is your best advice -- or just go straight to php.net and look in the php.ini for auto_prepend. Unfortunately, I've never tested this to determine whether it would apply to .html/.htm files as well as .php scripts - but the PHP gurus over there should know.
Regards,
DKDavid K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
Client and (unpaid) WHB Ambassador
mod_rewrite Tutorial Article (setup, config, test & write
mod_rewrite regex w/sample code) and Code Generator
-
Apr 6, 2005, 18:01 #5
- Join Date
- Apr 2001
- Location
- Canada
- Posts
- 5,458
- Mentioned
- 1 Post(s)
- Tagged
- 0 Thread(s)
In your php.ini file:
php_value auto_prepend_file '/home/dir/user/ads.php'Mike
It's not who I am underneath, but what I do that defines me.
-
Apr 6, 2005, 18:28 #6
- Join Date
- Jan 2005
- Location
- England (London Essex)
- Posts
- 0
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Thanks mike,
one more small problem... i did a "locate php.ini" in ssh and i got this response.
/var/cpanel/version/php.ini-2
/usr/lib/php.ini
/usr/local/lib/php.ini
/usr/local/lib/php.ini.new
/usr/local/cpanel/3rdparty/etc/php.ini
/usr/local/cpanel/3rdparty/lib/php.ini
/usr/src/buildapache/php-4.3.7/pear/tests/php.ini
/usr/src/buildapache/php-4.3.7/php.ini-recommended
/usr/src/buildapache/php-4.3.7/php.ini-dist
/home/cpins/installd/buildapache/php-4.3.8/pear/tests/php.ini
/home/cpins/installd/buildapache/php-4.3.8/php.ini-recommended
/home/cpins/installd/buildapache/php-4.3.8/php.ini-dist
/home/cpapachebuild/buildapache/php-4.3.10/pear/tests/php.ini
/home/cpapachebuild/buildapache/php-4.3.10/php.ini-recommended
/home/cpapachebuild/buildapache/php-4.3.10/php.ini-dist
which one do i edit?
Thanks, LW.
-
Apr 6, 2005, 20:08 #7
- Join Date
- Feb 2002
- Location
- Auckland
- Posts
- 14,692
- Mentioned
- 20 Post(s)
- Tagged
- 3 Thread(s)
Little,
Which one does Apache point to in httpd.conf? Given that list, I'd say it was /usr/lib/php.ini 'cause it wouldn't be the PEAR or CPanel ones nor the others with more than .ini as the extension.
Mike,
Will that auto-prepend to html files, too, i.e., not just .php scripts? TIA.
Regards,
DKDavid K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
Client and (unpaid) WHB Ambassador
mod_rewrite Tutorial Article (setup, config, test & write
mod_rewrite regex w/sample code) and Code Generator
-
Apr 6, 2005, 23:14 #8
- Join Date
- Jul 2001
- Location
- Italy
- Posts
- 4,514
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
are you using apache2 ?
-
Apr 7, 2005, 01:06 #9
- Join Date
- Feb 2002
- Location
- Auckland
- Posts
- 14,692
- Mentioned
- 20 Post(s)
- Tagged
- 3 Thread(s)
pippo,
Originally Posted by pippo
THANKS!
Regards,
DKDavid K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
Client and (unpaid) WHB Ambassador
mod_rewrite Tutorial Article (setup, config, test & write
mod_rewrite regex w/sample code) and Code Generator
-
Apr 7, 2005, 01:15 #10
- Join Date
- Jul 2001
- Location
- Italy
- Posts
- 4,514
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
David,
with Apache2 you can take the advantage of filters: http://httpd.apache.org/docs-2.0/filter.html
In pratice the filter will let you to modify the HTTP request or, more importantly, the HTTP response.
In pratice the filter is the *last* step to be executed before the response, i.e. the page content is sent back.
So in pratice the admin has only have to create a perl script, for example, that will parse the content of the page and then he can choose to insert into that html code what he wants, such as banner.
In that way the end-user can't, usually I think, avoid the ad/banner.
I never did it but the aim of the filter is that.
p.s.
I have an idea in the bag about filters and mod_rewrite but that's another story.
-
Apr 7, 2005, 04:27 #11
- Join Date
- Feb 2002
- Location
- Auckland
- Posts
- 14,692
- Mentioned
- 20 Post(s)
- Tagged
- 3 Thread(s)
pippo,
No wonder you're the GURU here! That's way over my head but, with your help, I've now got a starting place! Many thanks!
I'll look forward to your, er, article (or thread?).
BTW, I really like that signature -- how appropriate!
Regards,
DKDavid K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
Client and (unpaid) WHB Ambassador
mod_rewrite Tutorial Article (setup, config, test & write
mod_rewrite regex w/sample code) and Code Generator
-
Apr 7, 2005, 04:50 #12
- Join Date
- Jan 2005
- Location
- England (London Essex)
- Posts
- 0
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by Mike
; automatically add files before or after any PHP document
auto_prepend_file =
auto_append_file =
php_value auto_append_file '/home/vensions/www/ads.php'
Thanks, LW.
-
Apr 7, 2005, 05:06 #13
- Join Date
- Feb 2002
- Location
- Auckland
- Posts
- 14,692
- Mentioned
- 20 Post(s)
- Tagged
- 3 Thread(s)
Little,
What you told PHP to do was add '/home/vensions/www/ads.php' at the END of every page.
Also, I'd expect that php.ini requires the command to be on a single line but it's hard to tell that's what you've done with these text forums.
QUESTION: Are you PREpending to php pages or all pages? I'm not sure that auto_prepend_file will work with an html file unless you've told Apache to parse that as if it was php, too.
Regards,
DKDavid K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
Client and (unpaid) WHB Ambassador
mod_rewrite Tutorial Article (setup, config, test & write
mod_rewrite regex w/sample code) and Code Generator
-
Apr 7, 2005, 05:26 #14
- Join Date
- Feb 2002
- Location
- Auckland
- Posts
- 14,692
- Mentioned
- 20 Post(s)
- Tagged
- 3 Thread(s)
Little,
I'm just coming to grips with pippo's question about Apache 2.0 or later as the Include Element looks to be EXACTLY what you're after.
It's getting too late for me to make any sense of it now but go have a read!
Regards,
DKDavid K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
Client and (unpaid) WHB Ambassador
mod_rewrite Tutorial Article (setup, config, test & write
mod_rewrite regex w/sample code) and Code Generator
-
Apr 7, 2005, 05:59 #15
- Join Date
- Jan 2005
- Location
- England (London Essex)
- Posts
- 0
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by dklynn
Last edited by LittleWebmaster; Apr 7, 2005 at 09:34.
-
Apr 7, 2005, 09:34 #16
- Join Date
- Jan 2005
- Location
- England (London Essex)
- Posts
- 0
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
i attempted this but failed, can i pay someone to do this for me?
-
Apr 7, 2005, 17:54 #17
- Join Date
- Apr 2001
- Location
- Canada
- Posts
- 5,458
- Mentioned
- 1 Post(s)
- Tagged
- 0 Thread(s)
Sorry, I had my syntax wrong, I was going off memory...
Code:; automatically add files before or after any PHP document auto_prepend_file = '/home/vensions/www/ads.php' ;auto_append_file =
Maybe pippo's idea would be better suited...
Sorry I can't help much more than that.Mike
It's not who I am underneath, but what I do that defines me.
-
Apr 7, 2005, 18:35 #18
- Join Date
- Jan 2005
- Location
- England (London Essex)
- Posts
- 0
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
im too confused on pippo's idea... how can i make .html parse as php?
-
Apr 7, 2005, 19:03 #19
- Join Date
- Feb 2002
- Location
- Auckland
- Posts
- 14,692
- Mentioned
- 20 Post(s)
- Tagged
- 3 Thread(s)
Little,
Originally Posted by LittleWebmaster
Regards,
DKDavid K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
Client and (unpaid) WHB Ambassador
mod_rewrite Tutorial Article (setup, config, test & write
mod_rewrite regex w/sample code) and Code Generator
-
Apr 7, 2005, 19:24 #20
- Join Date
- Jan 2005
- Location
- England (London Essex)
- Posts
- 0
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
i didn't find a addhandler in php.ini but im shore there is one in httpd.conf
thanks for you help
-
Apr 7, 2005, 21:46 #21
- Join Date
- Feb 2002
- Location
- Auckland
- Posts
- 14,692
- Mentioned
- 20 Post(s)
- Tagged
- 3 Thread(s)
Little,
Actually, you should put it in httpd.conf if you can, otherwise, .htaccess (root level) should do it for you.
Glad to be of help -- but pippo was OUR guide! Don't forget Mike and Dean C's contributions. Aren't these forums great!?!
Regards,
DKDavid K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
Client and (unpaid) WHB Ambassador
mod_rewrite Tutorial Article (setup, config, test & write
mod_rewrite regex w/sample code) and Code Generator
-
Apr 8, 2005, 01:58 #22
- Join Date
- Apr 2001
- Location
- Canada
- Posts
- 5,458
- Mentioned
- 1 Post(s)
- Tagged
- 0 Thread(s)
I just pretend to know what I'm doing, pippo and dk are the ones who know stuff here
Mike
It's not who I am underneath, but what I do that defines me.
-
Apr 8, 2005, 08:56 #23
- Join Date
- Jan 2005
- Location
- England (London Essex)
- Posts
- 0
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by Mike
just kidding!, do you know how i can auto_prepend a file for just one account?
P.S. Yes these forums are great. thank you for everyones help !
Thanks, LW.
-
Apr 8, 2005, 09:34 #24
- Join Date
- Jul 1999
- Location
- Derbyshire, UK
- Posts
- 4,411
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
There used to be an Apache module called mod_banner to do just such a thing, can't seem to find it anywhere on Google though. Pippos idea about using filters is the best way to go if you're using Apache v2, or for v1, then I'd pay someone to write an Apache module - It's going to be so much faster than having HTML pages parsed as PHP to get them to work.
Karl Austin :: Profile :: KDA Web Services Ltd.
Business Web Hosting :: Managed Dedicated Hosting
Call 0800 542 9764 today and ask how we can help your business grow.
-
Apr 22, 2005, 16:35 #25
- Join Date
- Apr 2005
- Posts
- 1
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Dear LittleWebmaster,
Your site (www.vensions.com) was working beautifully until today, April 22, 2005. Is your site closed indefinitely or having issues?
I can't even contact you nor you respond back.
Cheers.
Bookmarks