Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Newbie php question, please ignore my ignorance

Status
Not open for further replies.

Luvsql

Technical User
Apr 3, 2003
1,179
CA
I've never had to deal with a php website before but unfortunately our web developers our away for 2 weeks and I simply want to view the source code of one page to see what the mysql script is it's using to update the data on a site.

I've only dealt with html or asp pages so it was really easy to do so with Dreamweaver or even notepad. Unfortunately viewing the sourcecode on the site doesn't show the actual php code.

Is there any simple way to view the php code? I have direct access to the webserver, which has php on it (site is setup in IIS not Apache) and I have full access to mysql using phpmyadmin.

I just need to see the code so I can then understand how the mysql tables are being read.
 
sure. just open the files that are on the webserver's file system within the document root.
 
I've tried that. The webroot is setup to be the cake\app folder and there is an index.php in there but there's no real code in it other than the following. There are about 8 other index.php files in various folders.

My issue is trying to find which source file to open. In html, you go to a page on a site and that's typically a subfolder under the main site. In php, there's no such thing. There's cake\app then a config, controllers etc folders.

I don't know where the pages are in php.


<?php
/* SVN FILE: $Id$ */
/**
* PHP versions 4 and 5
*
* CakePHP(tm) :
Rapid Development Framework ( * Copyright 2005-2010, Cake Software Foundation, Inc.
( *
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.

*
* @filesource
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. ( * @link
CakePHP(tm) Project
* @package cake
* @subpackage cake.app
* @since
CakePHP(tm) v 0.10.0.1076
* @version $Revision$
* @modifiedby $LastChangedBy$
* @lastmodified $Date$
* @license
The MIT License
*/
require 'webroot' . DIRECTORY_SEPARATOR . 'index.php';
?>
 
there is no rule about where the pages are for php. it is identical to html etc.

this suggests the the index.php page is in at webroot/index.php. probably cake/app/webroot/index.php if your comment above is accurate.

many coders code php apps on an MVC basis. so you the hard-stuff coding will be in a different folder to the templates. you will need to track through the code to where things are to be corrected. A professional in-house coder should have produced a functional map showing the entry points to the code and the various functions that are hit before the output is generated. perhaps check the documentation repository before messing about too much.

the alternative might be to write a quick script to parse all the files under the webroot and extract references to UPDATE ... or INSERT ... and then print them out with the file and line reference. then just go through those.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top