input1; $b = & $this->input2; /* Sleep awhile for show the loading */ sleep(10); if ( !is_numeric($a) ) { alert("A ($a) must be numeric"); ahide("output1"); /* stop ajax */ return; } if ( !is_numeric($b) ) { alert("A ($b) must be numeric"); ahide("output1"); /* stop ajax */ return; } aprint('output1', $a*$b); ahide("ashow"); } } /** * Example 1, source code * * This class shows how to read something from the client * and write something on the brower. * * @author Cesar D. Rodas * @package PHP-Ajax-Examples */ class example1_showsource extends phpajax { function main() { aprint('source', highlight_string( file_get_contents(__FILE__),true) ); } function loading() { } } /* Initiliaze php ajax*/ phpajax::init(); ?>