Creating the Input Forms and Scripts

Before you can add any posts, you must add a topic to the forum. It is common practice in forum creation to add the topic and the first post in that topic at the same time. From a user's point of view, it doesn't make much sense to add a topic and then go back, select the topic, and add a reply. You want the process to be as smooth as possible.

Listing 19.1 shows the form for a new topic creation, which includes a space for the first post in the topic.

Listing 19.1. Form for Adding a Topic
 1: <html> 2: <head> 3: <title>Add a Topic</title> 4: </head> 5: <body> 6: <h1>Add a Topic</h1> 7: <form method=post action="do_addtopic.php"> 8: <p><strong>Your E-Mail Address:</strong><br> 9: <input type="text" name="topic_owner" ...

Get Sams Teach Yourself PHP, MySQL® and Apache All in One now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.