Tech Talk Discuss PC Hardware, Software, Internet and Other Technology

php version of global.asa or application.cfm?

Old 02-18-04, 09:49 AM
  #1  
DVD Talk Gold Edition
Thread Starter
 
Join Date: Dec 1999
Posts: 2,708
php version of global.asa or application.cfm?

Does anyone know if there's a php equivalent of ASP's global.asa or ColdFusion's application.cfm file?

In case anyone is wondering, global.asa and application.cfm are somewhat of a default include for a directory (and all directories below it unless there are global.asa or application.cfm files in those directories). This page gets loaded before all ASP or cfm pages in a directory, so it makes it easy to start sessions and load certain site wide variables.

I figured there must be some kind of file like these in PHP, but I haven't come across any yet. Anyone know of one?
Thanks.
Lampei is offline  
Old 02-18-04, 10:03 AM
  #2  
DVD Talk Hall of Fame
 
Join Date: Jan 2000
Location: US
Posts: 9,629
You could create your own reference file, and add it in the php.ini
in the auto_preprend or auto_append section, and it will add that file to every script. I just add an include('reference.php') type of line to each page I do, works for what I need it to do.

dave
Dave99 is offline  
Old 02-18-04, 11:02 AM
  #3  
DVD Talk Gold Edition
Thread Starter
 
Join Date: Dec 1999
Posts: 2,708
And then you just drop this in the directory where the files are stored?

e.g.
www.mysite.com/folders/php.ini

will prepend whatever you drop in it before every file in the folders directory?

Thanks for the help.
Lampei is offline  
Old 02-18-04, 01:10 PM
  #4  
DVD Talk Hall of Fame
 
Join Date: Jan 2000
Location: US
Posts: 9,629
yep. You can use multiple php.ini's, so you can do different things in various directories..

dave
Dave99 is offline  
Old 02-18-04, 01:26 PM
  #5  
DVD Talk Gold Edition
Thread Starter
 
Join Date: Dec 1999
Posts: 2,708
Awesome! Thanks.
Lampei is offline  

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 On
[IMG] code is On
HTML code is On
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Thread Tools
Search this Thread

Archive Advertising Cookie Policy Privacy Statement Terms of Service

Copyright 2018 MH Sub I, LLC dba Internet Brands. All rights reserved. Use of this site indicates your consent to the Terms of Use.