This idea came from my days as a C programmer back eons ago.

I created a function called OutputDebugString() that takes a string as an argument and writes that string to a mysql table you create in your database (.sql code included).

From there, a seperate module, called from a supplied index.php file, will read the database and display its contents... refreshing every 3 seconds.

This eliminates a need for echo statements peppered throughout your code and mucking up your output. Instead, you can see the results of your work in a seperate tab/window while you are working through your code.

The only drawback is that the meta-refresh can get annoying if you are trying to work with the data but I can change that to a javascript function so that it can be controlled from the viewing page. I might also add a button to copy the debug output to the clipboard.

What I need is for a few folks to take a look at it and give me some feedback...

The entire code is attached as a .zip file.



8 Years
Discussion Span
Last Post by ppetree

OK, I've fixed the meta-refresh problem by handling the refresh via javascript and now you can turn refresh on/off and set the interval from a select box.

I also added a button to copy the debug output to the clipboard (strips out all the html).

Lastly, I added the abilty to show/hide the 'Select Variables' option table to give more room on the screen when its not in use.

Should be pretty functional for most folks.

Edited by ppetree: n/a


Thanks! I have found it to be extremely useful... much more so than using echo statements where the output gets overwritten by css placed html code.

I posted the lastest version on my site along with a rar package and a screen shot. You can find those at http://www.philpetree.com/phpdebugger

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.