HTML and CSS Reference
Step 4: Implement a login process
The add-session.php file is shown next. Put this file in the same directory as index.php, as
Listing 4.5. The add-session.php file
Now that you have the user's basic details sorted out, it's time to implement the application
Step 5: Send new chat messages to the server with AJAX
You accomplish the transport of data back to the server with traditional AJAX techniques.
The next listing shows the code for processing the chat form submit —nothing surprising
for experienced front-end developers. Create a file chat.js in your working directory to con-
index.php and put the code from the following listing in it.