Re: [PHP] Auto Prepend/Append

2001-03-07 Thread chris

On Tue, Mar 06, 2001 at 12:28:33PM -0600, Boget, Chris wrote:
  Is it possible to use the auto prepend/append directives to
  prepend/append particular files only to files with a particular
  extension?
  I don't believe you can do this directly with PHP but you 
  probably can with
  Apache: 
  Files *.html
  php_value prepend_file "foo.php"
  /Files
 
 Where do you put this?
 We've tried everywhere, but's not picking up.  Are you doing this?
 And it's working?

I just did a simple test using a .htaccess file. foo.php echos "foo"; bar.php
echos "bar".

Without anything in .htaccess, loading foo.php returns "foo" and bar.php
returns "bar". 

With php_value auto_prepend_file "bar.php", foo.php returns "barfoo" and
bar.php returns "barbar".

With this:
Files *.php
php_value auto_prepend_file "bar.php"
/Files

foo.php returns "barfoo" and bar.php returns "barbar".

With this:
Files f*.php
php_value auto_prepend_file "bar.php"
/Files

foo.php returns "barfoo" and bar.php returns "bar".

Switching from the .htaccess file to my Apache config file, this produces the same 
effect as that last Files... directive:
Location /prep/f*.php
php_value auto_prepend_file "bar.php"
/Location

foo.php returns "barfoo", bar.php returns "bar".

Doing the same thing with a Directory did not work.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Auto Prepend/Append

2001-03-06 Thread Boget, Chris

Based on what I read, I believe the answer to this question
is "No", but am hoping for confirmation because someone
might have been able to find a way to make this work.

Is it possible to use the auto prepend/append directives to
prepend/append particular files only to files with a particular
extension?

Say I have:

prepend.php
append.php

and I want these files to only be prepended/appended to ".HTML"
files and no other file type.

Is this possible?

Again, I think the answer is "no", but would like to see if anyone
might have done something like this...

Chris



Re: [PHP] Auto Prepend/Append

2001-03-06 Thread Chris Adams

On 6 Mar 2001 08:13:00 -0800, Boget, Chris [EMAIL PROTECTED] wrote:
Is it possible to use the auto prepend/append directives to
prepend/append particular files only to files with a particular
extension?

I don't believe you can do this directly with PHP but you probably can with
Apache: 
Files *.html
php_value prepend_file "foo.php"
/Files


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Auto Prepend/Append

2001-03-06 Thread Boget, Chris

 Try putting
 Files "*.html"
   php_value auto_prepend_file "foo.php"
 /Files
 in your httpd.conf file.  Once you put this in the conf file 
 for Apache, restart Apache and see if the changes take place.  
 That should do what you want it to.

Unfortunately, no.
Here is what we have in our httpd.conf file:

VirtualHost mydomain.com:80
Port 80
Files "*.html"
php_value auto_prepend_file "prepend.php"
/Files
DocumentRoot /this/is/the/path/to/mydomain.com
ServerName mydomain.com
/VirtualHost

We are running several different virtual hosts, but want this
change applicable to this one only.

Thanks for everyone's help thus far. Hopefully we can get this
up and running.

Chris