Use PHPRPC to implement AJAX secure login, and use phprpc to implement ajax_PHP tutorial

Source: Internet
Author: User
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.