The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

debug script for you :)

Hi Sitepoint users,

I found a crappie debug script in one of my php books. I could see its potential so I played with it and well... made it better : P I thought to myself what better place to share it. I have found it so far to be very useful.

Ok well you can use it how ever you want. My suggestion to include it at the bottom of your script.

It works with put action=debug1 or action=debug2 along the url pram

Eg.

Code:

www.testsite.com/page.php?action=debug1

(yep I know you get, just there for the new peeps)

Ok well in debug mode 1 the dump is at the bottom of the page in HTML and in mode2 the dump in bottom of the source page in html comments.

hope this helps

Ps. if you don't like it don't flame me, just move on and if you do like and want to improve it please post the updated version in this thread for me and others to see.

##note sorry for using code tags and not php code tags, the dam thing wouldn't work

this is an interesting idea.. i'll play with it when i have time and will post it then.. i think it will be great if some of more experienced PHP users post their ideas too.. there are some debuggers but i still don't use anyone of them.. can someone point me to the best one? maybe someone will post thoughts if such kind of debugging script is needed when using debugger, will be easier to display debugging information with it, etc.. if anyone have some thoughts and experience with debugging in PHP and wants to share them with others..

yes I would like to know about other out there too. I am about to start writing a massive php driven site JOY!! and was looking at building error, debug, testing code into to site code. I have been testing a few differnt ideas.

Here is what I have come up with. I am going to write a debug class, error reporting class (yes i know there are heaps) and a testing class.

The testing class is going to be the hardest, and as yet I haven't got a good idea of how to go about it.

The debug class is going to be easy and will be posted when I have finshed it. Oh and it will not be like this LOL but a more complex system.... If i can pull it off with out blowing our the code.