Newsletter subscription using PHP, Ajax, jQuery

Must Read : Newsletter subscription using PHP, Ajax, jQuery

Step 1: In our first step we create our database table to store user email address.
CREATE TABLE IF NOT EXISTS newsletter_signup (
email_id int(11) NOT NULL AUTO_INCREMENT,
email_address varchar(50) NOT NULL,
PRIMARY KEY (email_id)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ;

Setp 2: Now we create a subscription form where user put their email address. File name is index.php

Setp 3: Now we have to style our subscription form. So we create a style.css file for that

Step 4: Now we have to send user email address to a page. Here I use a js file to take email value from index.php and send the value using ajax post request to that page. So I create a addmail.js to do that.

Step 5: Now we create a connection file to connect php with mysql conn.php

Step 6: Now we create a php file which take the email value from addmail.js and insert the email address to our database table and return the status. So we create add_mail.php for that.

Step 7: In this file we fetch all email address from database table and show the list to administrator(just think). So we create list_email.php for that.

(Visited 28 times, 1 visits today)

Leave a Comment.