Welcome to WebmasterWorld Guest from 54.144.80.75

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

auto prepend file not working with .html and .css files

File types parsed as PHP are ignored

     
10:26 pm on Jan 4, 2009 (gmt 0)

Junior Member

5+ Year Member

joined:Nov 3, 2007
posts:131
votes: 0


I am having trouble using the auto_prepend_file PHP.ini directive, which automatically includes a file to every PHP script on my web application.

You see, in my .htaccess file I have the line "AddType application/x-httpd-php .html .css", which let's me include PHP code inside .html and .css files. Problem is my functions which are supposed to load in every PHP script are not being loaded in .html and .css files.

Is there a way to get around this? It seems to be working fine on my local machine, maybe this is a problem with my hosting company?

12:22 am on Jan 5, 2009 (gmt 0)

Junior Member

5+ Year Member

joined:Dec 26, 2008
posts:75
votes: 0


try creating the php code in a seperate file, and use:
include '';
7:41 am on Jan 5, 2009 (gmt 0)

Junior Member

5+ Year Member

joined:Nov 3, 2007
posts:131
votes: 0


frogz, of course I could simply just call the PHP file I am "auto_prepending" on every single .css and .html file I have, but that would of course defeat the purpose of using auto_prepend_file in the first place.

I love auto_prepend_file because this way I don't have to call include() on every script. I like having all functions and necessary start-up functions already included in every file. I don't wanna have to include that line to every single HTML and CSS file.

 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members