HTML and CSS Reference
In-Depth Information
Listing 4.2. index.php head
Step 3: Create a login form
In order to track which user is which, you need to have them log in, which means recording
their chat handle along with their PHP session ID. As mentioned in step 2, rather than cre-
ate a separate page for this, you're going to add another form into the index.php file, then
use conditional statements to turn the visibility of the form on and off. You're not going to
do anything fancy—the index.php page with the login form enabled is shown in figure 4.4 .
Figure 4.4. A simple login page for the chat application
As we just discussed, you don't need to create a separate PHP file for displaying the pre-
vious form—instead, you'll add conditional functionality to your existing index.php page.
Search WWH ::

Custom Search