Bluehost.com Web Hosting $6.95

auto_prepend/append in htaccess....

This is a discussion on auto_prepend/append in htaccess.... within the PHP General forums, part of the PHP Programming Forums category; I want to prepend a configuration file which is located outside of my document root into my scripts. I can ...


Go Back   Usenet Forums > PHP Programming Forums > PHP General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 11-13-2003
Jonathan Villa
 
Posts: n/a
Default auto_prepend/append in htaccess....

I want to prepend a configuration file which is located outside of my
document root into my scripts. I can use auto_prepend_file, but I'm not
sure how do it with an htaccess file or a virtual host entry.. I would
prefer VHost.

Anyway, this is what I am trying/assuming...

<VirtualHost 127.0.0.1 127.0.0.1>
ServerAdmin jvilla@isdesigndev.com
DocumentRoot /var/www/testdomain/www
ServerName testdomain
ErrorLog logs/testdomain-error_log
CustomLog logs/testdomain-access_log combined
<IfModule mod_php4.c>
auto_prepend_file=header.inc
auto_append_file=footer.inc
</IfModule>
</VirtualHost>

Is it possible to append/prepend more than file? Or would be better
to simply include one file and in that file include the others.

What should the file be relative to? Or should it be an absolute value?

I know that constants don't work outside of scripts, but I would like to
make this as smooth as possible.
Reply With Quote
  #2 (permalink)  
Old 11-14-2003
Jonathan Villa
 
Posts: n/a
Default Re: [PHP] auto_prepend/append in htaccess....

Anyone have any ideas on this?

On Thu, 2003-11-13 at 11:32, Jonathan Villa wrote:
> I want to prepend a configuration file which is located outside of my
> document root into my scripts. I can use auto_prepend_file, but I'm not
> sure how do it with an htaccess file or a virtual host entry.. I would
> prefer VHost.
>
> Anyway, this is what I am trying/assuming...
>
> <VirtualHost 127.0.0.1 127.0.0.1>
> ServerAdmin jvilla@isdesigndev.com
> DocumentRoot /var/www/testdomain/www
> ServerName testdomain
> ErrorLog logs/testdomain-error_log
> CustomLog logs/testdomain-access_log combined
> <IfModule mod_php4.c>
> auto_prepend_file=header.inc
> auto_append_file=footer.inc
> </IfModule>
> </VirtualHost>
>
> Is it possible to append/prepend more than file? Or would be better
> to simply include one file and in that file include the others.
>
> What should the file be relative to? Or should it be an absolute value?
>
> I know that constants don't work outside of scripts, but I would like to
> make this as smooth as possible.

Reply With Quote
  #3 (permalink)  
Old 11-14-2003
Eugene Lee
 
Posts: n/a
Default Re: [PHP] auto_prepend/append in htaccess....

On Thu, Nov 13, 2003 at 11:32:34AM -0600, Jonathan Villa wrote:
:
: I want to prepend a configuration file which is located outside of my
: document root into my scripts. I can use auto_prepend_file, but I'm not
: sure how do it with an htaccess file or a virtual host entry.. I would
: prefer VHost.
:
: Anyway, this is what I am trying/assuming...
:
: <VirtualHost 127.0.0.1 127.0.0.1>
: ServerAdmin jvilla@isdesigndev.com
: DocumentRoot /var/www/testdomain/www
: ServerName testdomain
: ErrorLog logs/testdomain-error_log
: CustomLog logs/testdomain-access_log combined
: <IfModule mod_php4.c>
: auto_prepend_file=header.inc
: auto_append_file=footer.inc
: </IfModule>
: </VirtualHost>
:
: Is it possible to append/prepend more than file?

I don't think this is possible with auto_prepend_file.

: Or would be better
: to simply include one file and in that file include the others.

This sounds workable.

: What should the file be relative to? Or should it be an absolute value?

It can be a relative pathname, in which case PHP will search its defined
include_path. Absolute pathnames should be okay too.
Reply With Quote
  #4 (permalink)  
Old 11-17-2003
Jonathan Villa
 
Posts: n/a
Default Re: [PHP] auto_prepend/append in htaccess....

Thanks for the info, but I was hoping on getting some information as to
why the code configuration I posted is not working.

On Fri, 2003-11-14 at 03:06, Eugene Lee wrote:
> On Thu, Nov 13, 2003 at 11:32:34AM -0600, Jonathan Villa wrote:
> :
> : I want to prepend a configuration file which is located outside of my
> : document root into my scripts. I can use auto_prepend_file, but I'm not
> : sure how do it with an htaccess file or a virtual host entry.. I would
> : prefer VHost.
> :
> : Anyway, this is what I am trying/assuming...
> :
> : <VirtualHost 127.0.0.1 127.0.0.1>
> : ServerAdmin jvilla@isdesigndev.com
> : DocumentRoot /var/www/testdomain/www
> : ServerName testdomain
> : ErrorLog logs/testdomain-error_log
> : CustomLog logs/testdomain-access_log combined
> : <IfModule mod_php4.c>
> : auto_prepend_file=header.inc
> : auto_append_file=footer.inc
> : </IfModule>
> : </VirtualHost>
> :
> : Is it possible to append/prepend more than file?
>
> I don't think this is possible with auto_prepend_file.
>
> : Or would be better
> : to simply include one file and in that file include the others.
>
> This sounds workable.
>
> : What should the file be relative to? Or should it be an absolute value?
>
> It can be a relative pathname, in which case PHP will search its defined
> include_path. Absolute pathnames should be okay too.

Reply With Quote
  #5 (permalink)  
Old 11-18-2003
Jason Wong
 
Posts: n/a
Default Re: [PHP] auto_prepend/append in htaccess....

On Tuesday 18 November 2003 06:46, Jonathan Villa wrote:
> Thanks for the info, but I was hoping on getting some information as to
> why the code configuration I posted is not working.


Because it's incorrect. Try:

php_value auto_prepend_file header.inc
php_value auto_append_file footer.inc

--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
May you live in uninteresting times.
-- Chinese proverb
*/
Reply With Quote
  #6 (permalink)  
Old 11-18-2003
Jonathan Villa
 
Posts: n/a
Default Re: [PHP] auto_prepend/append in htaccess....

easy enough, thanks!
On Mon, 2003-11-17 at 19:47, Jason Wong wrote:
> On Tuesday 18 November 2003 06:46, Jonathan Villa wrote:
> > Thanks for the info, but I was hoping on getting some information as to
> > why the code configuration I posted is not working.

>
> Because it's incorrect. Try:
>
> php_value auto_prepend_file header.inc
> php_value auto_append_file footer.inc
>
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.biz
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
> ------------------------------------------
> Search the list archives before you post
> http://marc.theaimsgroup.com/?l=php-general
> ------------------------------------------
> /*
> May you live in uninteresting times.
> -- Chinese proverb
> */

Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 04:43 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0