TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
Advertisement
Associates
Associates
techtuts Darkmindz
CSS Tutorials Tutorialsphere.com - Free Online Tutorials
Boston PHP SurfnLearn
Reply
 
LinkBack Thread Tools Display Modes
Old 02-26-2008, 12:31 AM   #1 (permalink)
Orc
The Prestige
 
Orc's Avatar
 
Join Date: Dec 2007
Location: On your Hard Drive, hiding like a Virus
Posts: 817
Thanks: 163
Orc is on a distinguished road
Default Xajax

This nifty PHP Library makes it easier to make AJAX scripts.

Example:
PHP Code:
<?php
include './xajax/xajax_core/xajax.inc.php';

$xajax = new xajax();

$rqstAdd =& $xajax->register(XAJAX_FUNCTION'doAdd');
$rqstReset =& $xajax->register(XAJAX_FUNCTION'doReset');

// set the parameters
$rqstAdd->setParameter(0XAJAX_JS_VALUE39);
$rqstAdd->setParameter(1XAJAX_JS_VALUE571);

$xajax->processRequest();

function 
doAdd($a$b)
{
    
$response = new xajaxResponse();
    
$response->assign('answer''innerHTML'$a $b);
    
$response->assign('reset''style.display''block');
    return 
$response;
}

function 
doReset()
{
    
$response = new xajaxResponse();
    
$response->clear('answer''innerHTML');
    
$response->assign('reset''style.display''none');
    return 
$response;
}
__________________
Wax on, Wax off
Orc is offline  
Reply With Quote
Old 02-26-2008, 01:10 AM   #2 (permalink)
The Contributor
 
DeMo's Avatar
 
Join Date: Jan 2008
Location: Brazil
Posts: 77
Thanks: 14
DeMo is on a distinguished road
Default

You forgot the URL: xajax PHP Class Library - The easiest way to develop asynchronous Ajax applications with PHP

I've seen this library before but personally, I prefer doing all AJAX stuff myself. Some time ago I was using AJAX in the admin panel of the system I had designed. In the user management pane you could browse/add/edit/delete users all via AJAX, without reloading the page. Browsing users was the most tricky cause the script downloaded a list of users (id, name, email, level etc) and had to dinamically build the HTML table with that information, I don't know if you can do this kind of thing using a library like XAJAX.
Send a message via ICQ to DeMo Send a message via MSN to DeMo Send a message via Skype™ to DeMo
DeMo is offline  
Reply With Quote
Old 02-26-2008, 01:11 AM   #3 (permalink)
Orc
The Prestige
 
Orc's Avatar
 
Join Date: Dec 2007
Location: On your Hard Drive, hiding like a Virus
Posts: 817
Thanks: 163
Orc is on a distinguished road
Default

I suck at AJAX. :[ If you could give me a reference, then that would be swell!

reference of all the codes.
__________________
Wax on, Wax off

Last edited by Orc : 02-26-2008 at 03:45 PM.
Orc is offline  
Reply With Quote
Old 02-26-2008, 03:13 PM   #4 (permalink)
The Acquainted
 
Gareth's Avatar
 
Join Date: Jan 2008
Posts: 132
Thanks: 3
Gareth is on a distinguished road
Default

I much prefer jquery or mootools!
Gareth is offline  
Reply With Quote
Old 02-26-2008, 03:43 PM   #5 (permalink)
The Contributor
 
abiko's Avatar
 
Join Date: Feb 2008
Location: Croatia
Posts: 89
Thanks: 4
abiko is on a distinguished road
Default

Prototype :)
jQuery (or Prototype/mooTools) with JSON :) the way to go.
Just create a little web interface for your AJAX script.
And you're rady to go. I don't belive in php solution that emulates javascript :)
__________________
if( !is_sane('abiko') ) punish::slap();
shadyHost | shadyDeer
Send a message via ICQ to abiko Send a message via MSN to abiko
abiko is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 12:20 PM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0