Enhancing Websites with PHP

Session Tracking

Now that you are familiar with the basics of PHP and MySQL, you undoubtedly are aware how quickly a project can increase in complexity. That is why it is so important to design your applications modularly and to name and organize your project files logically and meaningfully. Keep in mind also that a primary development goal is to avoid having to write the same code repetitively. By designing your applications to include files containing the code common to all pages you can develop your applications more quickly.

You may also have realized that currently your application allows anyone to edit or delete any guest in your database. While that is fine in a development environment in which the developer is the only one with access, it is not acceptable in a live environment. Guests should only be allowed to edit or delete their own information and to add that restriction requires having guests login. Once guests are logged in, you can then personalize their visit and track their actions using either client-side cookies or server-side sessions. Which you use depends entirely on the needs of your application, though know that sessions are generally more secure and more in your control because client users cannot delete them.

print