Accessibility

Dreamweaver Article

 

Managing multiple subscriptions in PHP


Joseph Lowery

Joseph Lowery

jlowery@idest.com

Table of Contents

Created:
28 April 2008
User Level:
Intermediate
Products:
Dreamweaver

As companies and organizations become increasingly web-savvy, they seek to strengthen their customer outreach efforts. This desire often manifests itself as e-mail–based newsletters. As noted in an earlier Adobe Developer Center article, Building a subscribe/unsubscribe app in PHP with Dreamweaver CS3, you can create all the code you need in Dreamweaver and PHP to handle individual subscriptions. In this article, you'll learn how to extend those capabilities so your client's visitors can manage multiple newsletter subscriptions. As a bonus, I'll show you how to incorporate an error message into a standard Dreamweaver login page.

  • Login.php: The login page verifies the e-mail address and password of anyone who desires to change their subscription settings. Once authenticated, the user is taken to the manage_sub.php page. If the log-on fails, an error message is displayed on the current page.
  • Manage_sub.php: The manage_sub page is the workhorse of this application. Here, all possible subscriptions are listed with accompanying check boxes. If a user is subscribed to one item, its check box is selected. Users can toggle their subscriptions on or off at will; once they've made their adjustments, a click of the Submit button updates their records and takes them to the thank you page.
  • Thank_you.php: A simple page that thanks visitors for changing their subscriptions.
  • Logout.php: This page contains code to log out the current user and return them to the login page.

Requirements

In order to make the most of this article, you need the following software and files:

Dreamweaver CS3

Sample files:

Prerequisite knowledge

You'll need to know how to set up a dynamic site in Dreamweaver and also have PHP and MySQL set up on your development system. You'll also need to understand how to restore a SQL file to a MySQL database. For information on how to set up PhP development environment, see Set up a PHP application server (Windows) and Set up a PHP application server (Macintosh).

About the author

Joseph Lowery's books about the web and web-building tools are international bestsellers, having sold more than 400,000 copies worldwide in eleven different languages. His most recent book is the Dreamweaver CS3 Bible. Joseph is the author of the recently published CSS Hacks and Filters as well as the co-author of Dreamweaver 8 Recipes with Eric Ott. A well-known speaker, he was presented at Adobe (formerly Macromedia) conferences in the United States and Europe as well as user groups around the country. Joseph is currently the Vice President of Marketing for WebAssist.