$id=$_GET['id']; $username="username"; $password="password"; $database="your_database"; mysql_connect(localhost,$username,$password); $query=" SELECT * FROM contacts WHERE id='$id'"; $result=mysql_query($query); $num=mysql_numrows($result); mysql_close(); $i=0; while ($i As you can see, this code will output a standard form, but instead of having blank boxes like on the form for inserting a new record, this one already has the current information from the database inserted into it.
This makes it much more effective for an update script.
The XMLHttp Request object is used to exchange data with a server behind the scenes.
While users are working their way around a page, the application maintains all kinds of background interactions.
The results of these interactions are used for the dynamic behavior of the application, such as updating field values; presenting users with instant validation feedback; filtering lists with selectable values; and updating the page with details of recent events, such as changes in the database, reception of chat messages, or new entries in RSS feeds of interest.
The DOM is accessed with Java Script to dynamically display, and allow the user to interact with, the information presented.
Java Script and the XMLHttp Request object provide a method for exchanging data asynchronously between browser and server to avoid full page reloads. JSON (Java Script Object Notation) is often used as an alternative format for data interchange, although other formats such as preformatted HTML or plain text can also be used for data purpose.
In this tutorial, I will be covering all basic and important facts you should know before working on ajax based application, to fully utilize the power of ajax. Ajax request and response objects - Useful methods (open(), set Request Header(), send(), abort()) Synchronous and Asynchronous requests - onreadystatechange event, Handling server response Demo application - Asynchronous example, Synchronous example Some popular ajax capable libraries - JQuery, Prototype Download source code It is important to understand that Ajax is not a single technology, but a group of technologies e.g. HTML and CSS can be used in combination to mark up and style information.
All modern browsers (IE7 , Firefox, Chrome, Safari, and Opera) have a built-in XMLHttp Request object.
If you are using IE 5 or IE6 (I wonder if someone still uses it), then Active XObject will be used for server communication to send ajax requests.
(This is a long process that takes many years.) Developers must not pass false for the async argument when the Java Script global environment is a document environment.
Today's Web 2.0 applications owe an important part of their rich behavior to their asynchronous communication with the server and their dynamic partial-page updates.