First off, I wonder that how can I locate the spot of the program flow on a web page if I have the source code? For example, when I am editing this post, my web address column of IE shows that “http://www.sitepoint.com/forums/newthread.php?do=newthread&f=34”. How can I trace the clue via “newthread.php?do=newthread&f=34” and find out which spot of the code in “newthread.php” that I am running?
Secondly, is there any debugging tool can break the program automatically when I click a button or its like? Ex. like the “Submit New Thread” button" that I am going to press for post.
I am new to PHP but I have few years experience on C/C++ and I am using Netbeans with xdebug as my IDE.
Thank you for your fast reply. The reason that I am interesting to track the URL is because I want to learn how to quick access the target spot of the source code. As you know there are many open source ecommerce and other web programs, I wish that I am capable to modify some of them for my own usage.
For example, recently I am studying phpbb3 and I wish to study and modify the part of code to set user permission in “administrator control pannel”, the URL I get is “http://bb.com/adm/index.php?sid=cc7c481d85b62f8797f2177644265bb1&i=permissions&icat=16&mode=setting_user_global”. Actually this URL is in my localhost and I know the php file I shall tracking is “adm/index.php”, but I have no idea how to use the rest of query string to locate my target code part quickly?
It would be very appreciated if you or anyone else can tell me how.
Well answers here for your questions:
First :
Though I am not sure what is your purpose to track the URL but if I have understood your question then see the following lines of code and try to see the output:
you must be directed now to the right direction to go ahead.
Secondly, though I haven’t tried it yet but as I have heard of that Neatbean as PHP IDE has that debugging feature. Otherwise simply what I do to debug is to echo the variables their places and see the output in the browser :p.