Webtrepreneur.co.za

Earn money online being a Webtrepreneur

May 7, 2007

Webtrepreneur Ajax Emailer

1 Star2 Stars3 Stars4 Stars5 Stars (2 votes)
Loading ... Loading ...

I have recently been spending some time looking into various methods that bloggers can use to increase the awareness of their blog. There are a number of ways, which this can be done. I have been focusing mainly around increasing traffic with your current traffic though. The simplest way is to set up some kind of referral form, where your readers can email an article they enjoyed to a friend, this is a highly effective method. Another way is to offers users a badge, which they can copy and paste onto their website. I prefer the referral system, as it’s a very direct form of marketing.

I spent some time looking into this method, taking note of the pros and cons, and I came up with one magor area of interest - Users don’t want to do things, which involve page refreshes. There is nothing worse than filling out a form, or taking part in a poll, and waiting for a page to reload after submitting the form. I feel that the thought of waiting for a page reload is enough to totally discourage someone from using a service. This is where a little ajax, some html and some php come in really handy. The ability to perform a task, and have that task handled behind the scenes is invaluable to anyone who runs a blog. As a programmer, these kinds of things interest me from a programming point of view, and I took some time to read about ajax, and managed to put together a nice little emailer item.

The program consists of three files, this is for user simplicity, in case you are interested in downloading the program and want to be able to easily adapt it to your website. If you are familiar with programming, I am sure you will quickly be able to compile it all together into one neat file.

emailer.php - This file consists of some very simplistic html tags to create a form with 3 elements, a javascript include statement, and javascript function call and a <div> success message class.

backend.php - This is a standard, straight forward php mailer script. It is very simplistic, feel free to adapt it. This file, you will need to open in notepad, for example, and change accordingly, to suite your needs. I have included some easy instructions to guide you.

ajax.js - The Ajax handler file, which processes the functions behind the scenes. I am not going to go into detail as to how this file works exactly, as that is not what this blog is about. If you are interested in programming, I’m sure you will be able to easily figure out what is going on, and if you are not interested, and just want to use the code, you don’t need to worry about this file.

If you are keen to use this little source code snippet in a website, which you currently author, this is what you must do:

  1. Upload the three files to your webserver
  2. Type <?php include(’emailer.php’); ?> in your .php file where you want to have the form appear

It’s really as simple as that. I hope you enjoy the snippet, I would have loved to go into detail as to how the whole thing works, but that is not what this blog is about, so perhaps another time. Please feel free to email me though, if you have any questions.

Download Webtrepreneur Ajax Emailer.


 Enjoy this article? Subsribe to my RSS Feed.
 TrafficSynergy Affiliate Network Click Here

Leave a Comment