jasgot
asked on
Where is my PHP site getting it's data?
I have been charged with supporting a custom programmed e-commerce web site. I need help figuring out two items. Not exactly sure where to start....
1) Figure out what database and how the PHP site is connecting to.
2) Figure out what table needs to be changed to make a change on the site.
I'm used to seeing a file like config.php that defines the database, db user, and password, but this config.php does not have any of that. There appears to be a lot of XML going on too.
1) Figure out what database and how the PHP site is connecting to.
2) Figure out what table needs to be changed to make a change on the site.
I'm used to seeing a file like config.php that defines the database, db user, and password, but this config.php does not have any of that. There appears to be a lot of XML going on too.
What is the URL of the site? We may be able to guess if we can see the "signature" in the generated HTML.
Other than that, you would start with index.php and read the code, looking for include() and require() functions.
Other than that, you would start with index.php and read the code, looking for include() and require() functions.
It's hard to say without seeing any code. Typically there would be a file which defines the database access details. Try searching for where some queries are and see if you can backtrack your way to eventually fine the database connection details.
It may also help to have some debugging in place so you can see what's going on as it's happening. For example you can have an IDE like NetBeans and enable x-debug. Either set a break point somewhere at the beginning, or if you find any queries set breakpoints there or have it pause at the first line. This way, you can view the code being executed line by line and when it starts doing anything db related it should show you where that file is and where everything is coming from.
It may also help to have some debugging in place so you can see what's going on as it's happening. For example you can have an IDE like NetBeans and enable x-debug. Either set a break point somewhere at the beginning, or if you find any queries set breakpoints there or have it pause at the first line. This way, you can view the code being executed line by line and when it starts doing anything db related it should show you where that file is and where everything is coming from.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
The data was hard coded in a .pl script on another server. Thanks.
check if the site a headerimported
ie: include(header.php)
somewhere in there there would be a link to the settings/config file.
Or, if it uses xml, the xml might have the config details
you can also perform a serch for the keywords : "server" thought the directories