Reputation: 13
I am not an experienced .php programmer but know enough to understand the code. A 3rd party company built a site for me where they are using a variable called domain and echoing that in the URL paths.
<?php echo domain;?>css/style.css
The variable is not declared on the page with $domain I cannot find where this variable is declared anywhere in the .php pages. Where else should I be looking for this?
Upvotes: 1
Views: 51
Reputation: 6120
You could try something like this:
<?
ini_set('display_errors', '1');
define("domain","somethingsomethingblabla");
?>
You add this to one of the files where echo domain;
exists, but before any includes, at the very top of the file.
So when you open that file, it will define the domain
constant, and when that same constant is defined in one of the included files, php will throw notice saying:
PHP Notice: Constant domain already defined in /path/to/file.php on line XX
And voila, there you go, there is a call to define domain
constant.
Upvotes: 0
Reputation: 8960
1) grepping
the variable name
via terminal
or any other cli
throughout your project
2) search in all the includes
in that file
3) search through all config
and extended
files
Upvotes: 0
Reputation: 10254
If this "variable" have not a $
before name, it is a constant.
Constants are defined in PHP using
define("constant_name", "constant_value");
Then you should find in your files for
define("domain"
or just for define(
And find the line that set the domain.
Upvotes: 1