Email Newsletter Subscriptions Using PHP and Dreamweaver - Part 2

The other day I posted an article on creating an Email Newsletter Subscription Application using PHP and Dreamweaver, today I want to share with you how you would go about building a page that gives the user the ability to unsubscribe from that list.

First of all if you haven’t completed Part 1 then I suggest you visit the link above and set that up first.

Create a page confirm_unsubscribe.php. Now this page is going to use a Record Set to define a single record using a Dreamweaver Server Behaviour., similar to the Subscription confirmation page. The only difference is that on this unsubscribe page the record will be deleted instead of inserted.

Place a Form on the Page Insert > Form with a hidden field that has a name if “ID”. This hidden field is going to get the value passed to it from the URL String. To do that, Insert the Hidden Field onto the page and then from the Bindings Tab (the tab that is under the Application Tool Pane on the Right), Click the + Icon and Select URL Variable. Once you have done that, while the hidden field is selected click the Bind Button to bind that value to the hidden field.



Next Step is to create a Record Set that will return the correct record.

From the Bindings Panel again, click the + icon and select Record Set, give the record set a name, select the connection and the table. Where we need to make some adjustment is the Filtering. So lets change the filtering section to pull the URL Parameter “ID” from the URL String. See below.




Now that we have a record set created we can use a couple of fields from that to personalize the confirm_unsubscrbe.php page. I would generally just write a short message and include the Users Name and Email Address. All you need to do here is place your cursor on the page and the spot where you would like these values to show and from the Bindings Tab expand the record set and select the field you would like and either drag it onto the page or click the insert button.



Lets now create the Server Behavior that will remove the user from the database…….

From the Server Behavior Tab, click the + icon and select Delete Record. Leave the First drop down box as is, which should be Primary Key Then select the correct connection and table from their respective drop down menus. Check that the Primary Key Column is set to ID.

From the Primary Key Value drop down list select Form Variable, because we are going to use the value from the hidden field that you inserted on the page earlier. Then select the page you want the user to be taken to after they click the Unsubscribe Button.



Save the page again and that is all folks! Just make sure that the page that the user is taken to after completing the unsubscribe procedure tells the user that the process has been completed, so they are confident that it has occurred.

I hope this has given you an easy alternative to creating an Email Newsletter list rather than needing to use a service like Aweber. I would still recommend that you use Aweber as it has a ton of functionality that you do not get with this solution, but if all you are after is a simple way to get email addresses and names of clients or readers then this is a god simple solution.

For more great Web and Blog Design Tips then SIGN UP for my Design Tips Newsletter. Once you have singed up you will receive a FREE Copy of the “Create a Working Contact Form” E-Book.


| del.icio.us | Digg it | Furl | reddit | StumbleUpon | Yahoo MyWeb

You can follow any responses to this entry through the RSS feed. You can leave a response, or trackback from your own site.

AddThis Social Bookmark Button

Fireworks CS4 468X60

One Response to “Email Newsletter Subscriptions Using PHP and Dreamweaver - Part 2”

  1. Thats a nice way to create forms. But are there any free newsletter subscription scripts out there to use which don’t require database?

Leave a Reply