Use PHPRPC to implement Ajax secure login _ PHP-php Tutorial

Source: Internet
Author: User
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 Ajax with content output redirection, hierarchical error processing, session-oriented, and service-oriented

Unlike other ajax frameworks, PHPRPC follows the principle of "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.
The code is as follows:
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.
The code is as follows:




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.