homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

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)

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)

try creating the php code in a seperate file, and use:
include '';

 7:41 am on Jan 5, 2009 (gmt 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.

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved