Remote Data Access
Generally, when there is a need to update what the visitor sees, or to make changes to the database on the server, we accomplish this by requesting a new page. However, there are times that it makes sense not to do so, but only to send changes to the server, or update an existing page without reloading it. There are many terms that refer to such techniques, such as RDA, DSO, and HTTP Tunneling, but they all mean pretty much the same thing: instead of loading a page again, we open up a separate connection to the server and only transfer the data that is changed.
This technique is particularly valuable when pages are large or there are a great many changes to be done with one screen of data. This is because the data that needs to be changed is almost always significantly smaller than the entire page, so the process can be completed quicker. This is a useful technique which cannot be accomplished with normal client-side scripting. It requires more sophisticated technologies such as Java.
This page uses RDA (more specifically, HTTP Tunneling) to accomplish data transfer, using a database table of planetary data. It uses a feature of modern browsers called the XMLHTTPRequest object to open a connection to the server each time the visitor changes the drop-down. A PHP script on the server extracts the information from the database and sends it back to the object as an XML data stream. Client-side scripting acts together with the object to change the appropriate parts of the page. Notice that the page is not reloaded; only the data changes.
View Planetary Data
| Choose planet: | |
| Orbital radius: | 1 AU |
| Orbital period: | 1 years |
| Orbital inclination: | 0° |
| Orbital eccentricity: | 0.017 |
| Planetary mass: | 1 x Earth |
| Planetary radius: | 6371 km |
| Planetary density: | 5520 kg/m3 |
| Planetary period: | 1 day |
| Planetary inclination: | 23.5° |
| Surface gravity: | 1 m/sec2 |
| Escape velocity: | 11.2 m/sec |
| Albedo: | 0.37 |
| Number of natural satellites: | 1 |

