Computer ForumsComputers  

Go Back   Computer Forums > Programmers Lounge > Programming Discussions > Programming Tips and FAQ

Reply
 
LinkBack Thread Tools Display Modes
Old 02-16-2007, 10:57 PM   #1 (permalink)
Dope Tech
 
Join Date: Jan 2004
Posts: 3,641
Send a message via ICQ to office politics Send a message via AIM to office politics Send a message via Yahoo to office politics
Default Use AJAX and PHP to Build your Mailing List

Use AJAX and PHP to Build your Mailing List
By Aarron Walter
November 1st 2006

Reader Rating: 9

An elegantly designed site filled with engaging content is worth very little without an interested audience. An opt-in mailing list is one of the most effective methods of making contact with your audience and driving repeat traffic to your site. If visitors enjoy and trust your site, they're likely to trust you with their email addresses -- after all, they'll want to be informed of new products, articles, or other relevant information. This is a great way to build relationships with your site's users, and encourage them to come back to your site again and again.

In this article, we'll learn to use AJAX to accept subscriptions to your mailing list without having to refresh the page; with this approach, your signup process will be quick and painless. Our AJAX sign up form will also be able to accept subscriptions from visitors who don't use modern, AJAX-capable browsers.

This article assumes that your mailing list is stored in a MySQL database, but as long as you have the necessary code to add addresses to your own mailing list, it should be easy for you to adapt the code presented in this article to your own signup process.

Before we get started, download the code, and take a look at what we'll cover in this tutorial.

The Big Picture
Our mailing list signup system has three key components:


An HTML form inside a PHP page receives the visitor's email address.

JavaScript will listen for the form submission, which will trigger the AJAX call to the server with the email address.

A simple PHP page on the server will receive the address. It will check the email address for errors, then store the address in a MySQL database. A success or error message will be sent back to the HTML page for user feedback.

We'll also ensure that this signup functionality is accessible to all, by writing a PHP-based sign up for users who don't have JavaScript enabled in their browsers.
__________________
Tech IMO.com | ExtremeTech.com | ASP Free.com | SysOpt.com | Tech Support Guy.org
DB Forums.com | Cyber Tech Help.com | Lazy Forums.com | Warrior Nation.net

'If you don't stand for somethin you'll fall for anything' - Dr. Dre Been there, done that
office politics is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 12:26 AM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0