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.

Thanks,

Pete

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.

Member Avatar for rajarajan2017

Thanks for you effort. And let I will check that in my free time and give you the feedback.

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.