homepage Welcome to WebmasterWorld Guest from 54.227.25.58
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
How to find which files and folders specific code is in
TopWebNames




msg:4227627
 11:33 pm on Nov 6, 2010 (gmt 0)

Hi. I'm far from being a programmer. I've learned enough to do simple HTML and PHP editing, moving elements around, etc.; but that's about it. Since I don't know how most commands/instructions work yet, most of the time I can't figure out which files, in which folders the code or elements are in that I want to change.

The Page Source is sometimes helpful, but it doesn't tell me in which file in which folder most of the code often is.

I use Firefox, so I've been using Firebug. It's very illuminating as to what the code or element is, but again/still... most often I still can't figure out if there's a way in Firebug to know which file, in which folder, a line of code is actually in. Is there a way to find this with Firebug?

Or, are there any other programs/tools that let me point to or click on anything on a web page, and it will tell me in which file, in which folder, that code or element is?

Thanks!

 

coopster




msg:4227722
 12:54 pm on Nov 7, 2010 (gmt 0)

Welcome to WebmasterWorld, TopWebNames.

You can use your operating system search tools to locate a phrase in a file, or if you are using a development environment you can use the search (and replace) tools included in the software.

TopWebNames




msg:4227733
 1:52 pm on Nov 7, 2010 (gmt 0)

Hi coopster. Yes, I've tried this, but Windows Vista Search is a real hassle to use. However, your suggestion just made me realize that instead of just not wanting to use the Windows Vista Search tool, I should search for much better Search tools that are easier and more straight forward to use. Thanks!

eelixduppy




msg:4228047
 3:05 pm on Nov 8, 2010 (gmt 0)

>> Or, are there any other programs/tools that let me point to or click on anything on a web page, and it will tell me in which file, in which folder, that code or element is?

If you look at the URIs to the files it will tell you the location relative to the web servers root directory, but even then this sometimes isn't the case depending on how your web server is configured. If you are trying to change around a large project (e.g., Wordpress) it can be a little confusing at first, but just keep at it and you'll eventually find how all the pieces come together.

TopWebNames




msg:4228075
 4:23 pm on Nov 8, 2010 (gmt 0)

Hi eelixduppy. Thanks, but the problem for me is that PHP includes are processed on the server and are not seen by browsers. While a page may include processes in many PHP files, the browser will only see one HTML file which is then the end product of the main file and all the includes, etc.; so someone really knows what they're doing in PHP to be able to see what's happening behind the scene... on the server... to know where to look for each other PHP file is being used for each action and element.

This is why I'm looking for a tool or tools that can track what's happening and especially where it's happening so that I can find where to edit code that isn't actually on the page that's being displayed by a browser.

Anyango




msg:4228336
 7:58 am on Nov 9, 2010 (gmt 0)

Sorry if i misunderstood it, but cant we just just look at the php source code and see whats all where ? i mean you are the programmer you know where all the php code is, isnt it so? also if you enable error reporting in php and there is an error it will tell you even the line number

Readie




msg:4228425
 12:56 pm on Nov 9, 2010 (gmt 0)

If you're on a Linux system, you can SSH in and do the following command:

grep -rio "string you want to find" *

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved