I have a constant
like define('SITE_URL','http://somewebsite.com');
I am using it on some pages
Some time also changing the value of that variable so that it is a pathetic task to go on each page and change the variable value .
Please suggest me some alternative like some automatic class loader or any other method .
Since it is my first PHP web so I am unable to decide what to do here ?
First of all a
defineis not a variable.To use it in multiple pages, put all your defines in a separate PHP file, and include it in other php files when you want to use it.
example:
in defines.php:
in page1.php:
etc.