Use PHPRPC for AJAX secure logon and phprpc for ajax. Use PHPRPC for AJAX secure login, phprpc implementation of ajaxPHPRPC is a lightweight, secure, cross-Internet, cross-language, cross-platform, cross-environment, cross-origin, and support for complex objects. using PHPRPC for AJAX secure login, phprpc implements ajax
PHPRPC is a lightweight, secure, cross-Internet, cross-language, cross-platform, cross-environment, cross-domain, support for transmission of complex objects, support for parameter reference, and support high-performance remote process call protocol that supports content output redirection, hierarchical error processing, session-oriented, and service-oriented.
Unlike other ajax frameworks, PHPRPC follows the"Only do one thing and do it well. It is only responsible for data transmission, and will be the best transmission! It makes it easy for you to do things that were previously impossible or difficult to do with the traditional ajax method!
I believe that one of the main reasons why many people choose PHPRPC is that it makes it easier for you to develop ajax applications! Although the power of PHPRPC is not limited to this, I have to admit that this is indeed a highlight of PHPRPC!
So, let's take a look at how to use PHPRPC 3.0 to compile ajax applications.
The following is a simple example (or even a boring example: mrgreen:) to illustrate how to use PHPRPC 3.0 to write ajax applications. This example shows how the MVC pattern mentioned above works. Here we will take the PHP Server as an example. The first example is simple. the client inputs a string and the server calculates its SHA1 value.
?
require_once ( "../php/phprpc_server.php" ); $server = new PHPRPC_Server(); $server ->add( "sha1" ); $server ->start(); ?> |
With such a simple 4-line code, PHP's built-in sha1 function is released. Now, the client can directly use this function.
?
"-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" > "http://www.w3.org/1999/xhtml" >
"Content-Type" content= "text/html; charset=utf-8" /> Calculate SHA1
|