tags:

views:

143

answers:

4

Hello ,

I have many requires and includes and i was wondering if there's something that can help me look at the whole of php code when a webpage is loaded. the reason i'm asking is that after fiddling with some code i cannot put any php code anymore as it will not be "sensed" by the compiler. like if i put anything inside the php tags

it won't give me an error saying the function doesn't exist. Thanks to anyone taking the time reading this.

+3  A: 

Not entirely sure what you are after...

The get_included_files function can allow you to view a list of all of the files php has loaded at that point.

You may also find using grep or the "find in files" function in your editor (if it has one) can help you track down something in the code that you know is there any can't find.

And finally, the errors thing - call the following functions at the top of your script to make sure errors are being output:

error_reporting(E_ALL);
ini_set('display_errors', 1);

This still won't catch parse errors.

Please don't use those in a live system, only in development - its not good to show error messages to users, and they contain info that might aid anyone looking to compromise your system.

So.... not sure of the question, but I've answered what I think it might be.

benlumley
+2  A: 

You can't examine PHP code in the browser as it executes server side and then simply displays the output to the browser. You have to manually add in the ability to see what occus in the code, via echo statements or possibly logging the information.

jtyost2
+1  A: 
CMS
webgrind is good to use with xdebug.http://code.google.com/p/webgrind/
benlumley
A: 

You can't look at PHP code that's not running on your computer. The idea is that the code inside the PHP tags (<?php ?>) is popped out, run, and then whatever the output is is snuck back in where the tags were before the final version is sent to your computer. Thus, you can't see the code on your machine.

What you need to do is get an FTP client to FTP into the server in order to see the code.

mattbasta