Jump to content

Global Variables


mattyvx

Recommended Posts

Hi,

 

Take this example;

 

I sell one service on my website. On many pages the cost of this service is displayed: Say the repeated statement "12month membership for £20".

 

The cost may vary from time to time and I do not wish to change every statement. Taking this to another level, my site has many repeated statements, what is the best way to display these 'would be' variables on my website.

 

Do i create a "master" php script and include it on every page? Is there a better way like configuring all pages to reference this master via htacess (for example)?

 

Your thoughts,

Link to comment
https://forums.phpfreaks.com/topic/188104-global-variables/
Share on other sites

if you need to include a page, than you include a page. A programmers gotta do what a programmers gotta do. Efficiency will only come into play if your start including gigantic files. But if you include files with a few lines its basically the same (well a little different) as just copy pasting the lines to wherever the include command is.

 

 

Link to comment
https://forums.phpfreaks.com/topic/188104-global-variables/#findComment-993089
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.