HTML and CSS Reference
In-Depth Information
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
per the file layout in figure 4.3 .
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
functionality.
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-
tain all of your JavaScript code; as per figure 4.3 you can create it in the same directory as
index.php and put the code from the following listing in it.
Search WWH ::




Custom Search