Where Knowledge Rules

Computers & Technology:

Internet

Get a Widget for this title

Ajax web technology explained

is a connection (stream) with the executable file, the text goes to the client instead of the server monitor. However, before you send the required text, you must first send the following information:

Content-Type: text/html\n\n

This explains why you have the first print statement. The required text is in the variable, $value. The second print statement sends the required text.

Illustration with PHP
There are two PHP programs below. Each of these programs does exactly what the Perl program (code segment) above does. With PHP, if Ajax used POST to send the query string, then at the server, PHP will have the name/value pairs of the query string in an associative array, called $_POST. This is an internal PHP array and it is globally accessible. An associative array consists of keys with corresponding values. For the query string name/value pairs, the $_POST array keys are names, while the corresponding array values are query string values. The following PHP code is for the POST method:

<?php
$value = $_POST["fname"];
echo $value
?>

This is a PHP executable file whose name has to be in the URL of the Ajax code at the client. There are two lines in the code. The first line uses the name, "fname" as key of the $_POST associative array to obtain the value, "John". This value is assigned to the variable, $value. Remember, the associative array will always hold the query string sent. The second line in the code sends the value "John" into the stream of the connection.

The following code does the same thing, but for the GET method. Here PHP has the $_GET associative array to hold the name/value pairs of the query string, sent by Ajax, using the GET method.

<?php
$value = $_GET["fname"];
echo $value
?>

Conclusion
At the server there is no new standard or technology for Ajax. All you have to know is how a language gets the data from the query string sent and how it sends text (any string) back into a connection stream initiated from the client. You can use any language for this: C++, Borland Delphi, Visual Basic.net etc. I have used only perl and PHP for illustration.

Learn more about this author, Chrys.
Contact this writer Click here to send this author comments or questions.


Below are the top articles rated and ranked by Helium members on:

Ajax web technology explained

  • 1 of 5

    by AJL

    I cannot express how much I really LOVE AJAX. I have been a web developer for the past 8 years and I have to say that microsoft's

    read more

  • 2 of 5

    by Obsidian

    What is AJAX? Well, the textbook definition, Asynchronous JavaScript and XML, is not of much help to the average reader

    read more

  • 3 of 5

    by Chrys

    Making Ajax Request
    Ajax Web Technology Explained Part 1

    Introduction
    This is part 1 of my article series, Ajax Web Technology

    read more

  • 4 of 5

    by Fred Lawrence

    The acronym Ajax meaning Asynchronous Javascript and XML,refers to the use of several web technologies in an application

    read more

  • 5 of 5

    by ARC IDEA CO

    In e-business's point of view, in order to appeal to its customers of clientele, you need to have a website or a web front.

    read more

Add your voice

Know something about Ajax web technology explained?
We want to hear your view. Write_penWrite now!

148828

Featured Partner

ResearchSEA - Asia Research News

ResearchSEA - Asia Research News is Asia's first research news portal. It is a one-stop center where journalists a...more

What is Helium? | Buy Web Content | Contact Us | Privacy | User agreement | DMCA | User Tools | Help | Community | Helium’s Official Blog | Link to Helium

Helium, Inc.
200 Brickstone Square Andover, MA 01810 USA