Subject:*
<
Name/Email:*
<
Message Icon:*
<
Select*
<
Message:*
<



Click the Preview to see the content in action.
Options:*
<
Confirmation Code*
<
2 + 5 = ?  
Input the result from the expression
Maximum attempts you can try: 10
*
<
     
registerFunction("processFormData"); //$xajax->setFlag("debug", true); $xajax->processRequest(); $Xjavapath=XOOPS_URL.'/modules/tutorial/class/xajax'; $xajaxjava=$xajax->getJavascript($Xjavapath); $xoopsTpl->assign('xajaxjava', $xajaxjava); [/code] [color=000033]PHP FUNCTION[/color] [code] function processFormData($arg) { $newContent = "Value of field: ".$arg['myfield']; $objResponse = new xajaxResponse(); $objResponse->assign("thisID","innerHTML", $newContent); return $objResponse; } [/code] [color=000033]HTML PART[/color] [code] [/code] [size=medium][color=0066FF]Now with ajaxify:[/color][/size] [color=000033]HTML PART[/color] [code] The easy way [/code] [color=000033]PHP FILE WITH PHP FUNCTION[/color] [code] function ajaxy($arg) { $Hello="welcome to my world at $arg"; return $Hello; } $tst=ajaxy($_POST['tst']); echo $tst; [/code] Now the xajax part has incomplete code since I'm missing a function to trigger on mouse click, while the ajaxify code has this. While I like to use this jquery plugin, You could just as easily have done this with jquery alone (without plugins). Initially, I was a little hesitant from switching away from xajax; First because I wasn't familiar with javascript and was a little fearfull of jumping into another language, god knows how much learning it's taken to understand PHP. Second, why leave xajax if I'm profiecient at it? For the first reason, javascript really isn't that hard to learn if you already understand PHP. The basics are quite similar. The second part has a 2 part answer: 1- Simplicity! With xajax you are required to create a xajax function that serves as an conection between javascript and PHP ($xajax->registerFunction). Now when designing with xajax, all calls HAVE to go back to the server. So you are not really taking advantage of javascript wich is a client based language. For instance, you have a table of data and you want to sort by column's. Using old Xoops, you would create an image link that would do a new DB query and reload the whole page. With Xajax, you still do the DB query but only reload the table. With Javascript, once the table is loaded on the client he can sort it as he pleases without any further DB queries! This is great because it's less load on the server. So now you can benefit from javascript, and when necessary do ajax calls to get PHP code. 2- Less code/ faster development. Since I've switched (after an initial learning curve about the basics of javascript) I've been coding with ajax much quicker and taking advantage of an incredible library of plugins available to jquery! Just look at (http://jqueryui.com/demos/draggable/) to see some standard plugins/effects that come with Jquery. Also, since it's a framework, you can easily add more and more plugins to your page. Of course it's not perfect. There are some issues you do run into. However you can use firebug.js and frankblack's great module to troubleshoot any problem either in php or javascript. I'm going to post a list of useful jquery plugins if people are interested. I've already written a jquery tutorial that's available on my site on how to create XOOPS admin menus. I'm thinking of creating a new one that's more of a beginners guide to javascript.[/quote]" />

Re: PHP-Debugging without XOOPS
by Mamba on 2011/4/4 7:33:16

I have updated the package to the latest FirePHPCore files, and have written a short tutorial for Debugging XOOPS with FirePHP.

See more in this thread

Feedback and improvement suggestions for the Tutorial are appreciated.
Re: PHP-Debugging without XOOPS
by kaotik on 2009/11/3 13:14:02

version 1.3 doesn't seem to work with XOOPS 2.4.1
It gives a fatal error.
Re: PHP-Debugging without XOOPS
by kaotik on 2009/8/13 10:44:55

bumciach: I used to do tables using ajax also, I've since partially abandonded it, Why?
Well javascript is a client language, meaning all manipulation is done on the clients side. I load the necessary info for the table unto the clients computer, then let javascript take over and sort it. This way the client can interact with the info as he/she see's fit, without placing an additional burden on the server.
This is what I'm using: Demo Home page. With this you can load 400/600 (or more) records onto the users computer and this jquery plugin will break the results into pages, perform sorting, allow the user to select how many records to see at once and even search through the records. This is the power of javascript.
I've been reading through jqGrid and it's also a great plugin. It can perform the same way. I'm actually going to do some testing with it
Re: PHP-Debugging without XOOPS
by kaotik on 2009/8/13 10:29:38

I wasn't happy with the ajaxify was behaving so I used another plugin for the same example. This one uses a submit button. You can read about the plugin here:
http://www.malsup.com/jquery/form/

jqueryForm example
Re: PHP-Debugging without XOOPS
by frankblack on 2009/8/12 18:53:03

Cool! Thx a million, I'll test an report. If it is really so simple ... then ...

Who's Online

195 user(s) are online (157 user(s) are browsing Support Forums)


Members: 0


Guests: 195


more...

Donat-O-Meter

Stats
Goal: $15.00
Due Date: Jul 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $15.00
Make donations with PayPal!

Latest GitHub Commits