Click here for Toll-Free Service for your business starting at $2.00 per month
Started by sixthcrusifix, January 11, 2006, 10:24:41 PM
Quote from: webzone on January 11, 2006, 11:56:29 PMYou can't set variables that will be available in all your scripts. The only way is to set those in a file and then use include(), require() or auto_prepend_file (the latter is in the php config file).Including a file takes a bit more time to process but not by much. For instance, I'm using Wordpress on a site that I manage. Wordpress includes at least a dozen files when any page is requested, but my page still appears pretty quickly and this does not seem to cause too much problems.You can improve performance by using constants instead of variables, but you will not be able to change their value. A great advantage is that constants are automatically global, so you can use them inside any function without having to use the "global" keyword.If you choose to use include(), keep in mind that you must give the path of the desired script on the local system (ie. use /fpgs/... instead of http://...).