How to debug php Script at Broswer URL ? (a-la toolbar) |
Site Admin
|
there are few ways to run debug session with a script being executed as a result of POST or GET request.
1. you can add debug session request to the form where you run POST or GET. For example <form ....> <input type=hidden name=DBGSESSID value="1@clienthost:7869"> ... </form> 2. header("Location: http://yourwebhost/yourscript.php?DBGSESSID=1@clienthost:7869"); 3. if your form is in the php script that you were debugging and you got resulted HTML page in the output window, you just press submit on the form to continue debugging. No special actions required. It's done using HTTP cookie. 4. add DebugBreak() function call somewhere in the script. |
||||||||||||
Last edited by dmitri on Wed Jul 30, 2003 12:34 pm; edited 1 time in total |
Very good!DebugBreak is working! |
|
;Thanks very much!
|
||||||||||||
|
|
You can make yourself a little "Debug" button in IE like this:
1) Add a new link to the links toolbar. 2) Set the link's target this:
exactly as it's shown here. Ignore the warning about javascript not having an handler. IE isn't aware of what it's cabaple of... 3) Change the link's name to whatever you want. for example "Debug with PHP Ed". Now by clicking this link you will re-run the url you are currently in with all it's query string in debug mode for PHP Ed. From this point on the debug session for that windows will persist, as dimitry pointed out. There is probably a "cleaner" way to do it by settings cookies from javascript. You can even turn off the debug session that way. But for our humble needs this is quite useful. |
||||||||||||||
Last edited by Post-O-Matic on Tue Aug 19, 2003 11:02 pm; edited 2 times in total |
|
Here's a "Debug off" javascript code:
This is IE specific. |
||||||||||||||
|
Debug button in IE |
|
Hi, merry christmas to all !!!
i´ve use windows XP e IE 6.0.28 and in my computer the IE does not support the "source javascript" like target of the link button. How can i do that to create a "debug button" in the link´s bar? tks |
||||||||||||
|
|
Here's everything you need to execute javascript via a link or a button |
||||||||||||||
|
|
To make a link that appears in the IE Link Bar (Even in IE 6):
Add a page to favorites. Any page will do. Name it something like Debug. Put it in the Link folder. Edit that bookmark (Right Click and choose prperties). Replace the url with: javascript: var str = new String(location); str += str.indexOf('?') == -1 ? '?' : '&'; str += 'DBGSESSID=1@clienthost:7869'; document.location = str; This should all be on one line. Say yes when it warns you. That will do it. Note, however, that this will only solve your problem if the script uses GET. Because this reloads the page, POST data will be lost (As will HTTP_REFERER, etc.). |
||||||||||||
|
|
These will copy over the query string so you don't lose that.
DEBUG OFF: javascript:location.href=location.protocol+'//'+location.hostname+location.pathname+(location.search ? location.search +'&' : '?')+'DBGSESSID=-1' DEBUG ON: javascript:location.href=location.protocol+'//'+location.hostname+location.pathname+(location.search ? location.search +'&' : '?')+'DBGSESSID=1@clienthost:10001;d=1,p=0' |
||||||||||||
|
How to debug php Script at Broswer URL ? (a-la toolbar) |
|
||
Content © NuSphere Corp., PHP IDE team
Powered by phpBB © phpBB Group, Design by phpBBStyles.com | Styles Database.
Powered by
Powered by phpBB © phpBB Group, Design by phpBBStyles.com | Styles Database.
Powered by