HomeBusiness Websites Blog
XML/RSS

   HomeBusiness Websites Journal
If you want to receive the full articles, you will need to subscribe to the HomeBusiness Websites Journal. Please submit your address in the box above.

Building a SEO Template Part II
-- Posted by Steve on Tuesday, October 26 2004

My stats are showing only about 20% of you are interested in this template tutorial. This is Part II and the final part, so if those of you who are not interested... we will talk about something else next week.

Last week I said:

Now let's look at #right div:

#right {
 border :  black solid 2px;
        border-top: 0;
 border-left: 0;
 width: 145px;
 height : 300px;
 float: right;
 background-image: url("images/right-background.gif");
 background-repeat: repeat;

}

What we want to do now is add a bit more to the #right div. We want to put some links in here to other sections or whatever you want to link to. I think a nice CSS mouseover would be appealing.

You can see it in action here:
http://homebusiness-websites.com/tutorial2

The only code we add to the html template is the links:

<div id="right"><ul>
 <li><a href="http://">Section #1</a></li>
 <li><a href="http://">Section #2</a></li>
 <li><a href="http://">Section #3</a></li>
 <li><a href="http://">Section #4</a></li>
 <li><a href="http://">Section #5</a></li>
</ul>
</div>

A "div" means a division of a web page. Each division can have its own characteristics that are separate from the other parts of the web page. So the first thing I did to the #right div was setup the fonts by adding this code to #right:

font-family: arial, sans-serif;
font-weight: bold;
font-size: 10pt;

Then we need to define some of the other elements within this div:

#right ul {list-style-type: none;
           margin: 3mm;
           padding: 25px 0 25px 0;
 }
#right li {margin: 0;
           padding: 5px 0;
 }
#right li a {color: black;
             padding: 10px 0 10px 20px;
      background: url(images/brown-button.gif) no-repeat 0 50%;
      text-decoration: none;
 }
#right li a:hover {margin: 0;
                   background: url(images/brown-button-hover.gif) no-repeat 0 50%;
     color: red;
     text-decoration: none;
 }

When you specify all of the values to a property such as padding in the main UL, the values start at the top, and move clockwise. So the first value is the top padding, the second is the right padding, the third is the bottom padding and the fourth is the left padding value.

I create the two images the brown and red blocks which are 10x10 and the #right li a:hover color is set to red, so that when you mouseover a link, both the block and text turn red.

If you have followed this example, you should have a nice looking mouseover navigational menu without using any Javascript. Search engines won't have any problem indexing these links.

One other thing that is a good idea to add is another stylesheet:

<link rel="stylesheet" type="text/css" href="print.css" media="print" />

In modern browsers when want to print the page you can use an alternate stylesheet by specifying the media type as "print" which allows alternate formatting.

In this stylesheet I've removed all the graphics except for the validation buttons at the bottom, and also changed the 2px border around the template to 0px. If someone wants to print off your article, there isn't any sense in using up all of their colored ink or having borders on the printed page.

It probably wouldn't hurt if you were building templates this way to include some contact information at the bottom of the article. That way if your article gets printed off, anyone who sees it will know where to find you.

You can also try experimenting swapping out the images with other ones. If you replace the header, background and tiled image of the navigational column, you will have a whole new template.

Including the images, stylesheets and the html page itself, the total files size is 39KB and download of this template and article is:
33.6K   12.89 seconds
56K  7.81 seconds

On DSL/Cable it is about 2 seconds.

For those who are interested in exploring SEO friendly templates a little more, you can download all of the files used in this tutorial in a zippered file:

(Note: Sorry -- the download is only for subscribers to the HomeBusiness Websites Journal)

The images folder in this zippered file are common to both webpages. The file called "index2.html" uses "stylesheet2.css" and "print.css."

If you wish to discuss this tutorial or anything else published in this newsletter, please visit my discussion board at:
http://talk.homebusiness-websites.com

NOTE:

Another template I did had to be validated as XHTML 1.0 Transitional because of the Javascript. I noted with this template that the when you try to use an alternate stylesheet for printing that sometimes the styles from both stylesheets will be inherited. This isn't good.

To prevent this from happening you can call your two stylesheets in this way:

<link rel="stylesheet" href="print.css" type="text/css" media="print" />
 <style type="text/css" media="screen">@import url("stylesheet.css"); </style>

The @import method for screen isn't recognized by older browsers and seems to stop the template from inheriting style from this stylesheet when you print off the web page.

You can see an example here:
http://homebusiness-websites.com/apple

Building a SEO Template Part 1
-- Posted by Steve on Tuesday, October 19 2004

I see a common theme on Internet now of making use of templates. Whether it is for link directories, SEO optimization or directory generators such as Front Page or SmartPages. idea is to get these pages a good ranking in search engines to help draw traffic into your site.

There a numerous theories of how search engines index your site, how far they crawl down page for content. There are still search engines that support META tag and ones that don't... such as Google.

So idea behind template is to try and get content of your page as close to top of document as you can, so that search engines that don't support META tags can read some of your content. Let's look at a possible template:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
 <head>

    <title>Something descriptive</title>

<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<meta name="mssmarttagspreventparsing" content="true" />
<meta name="Description" content="" />
<meta name="Keywords" content="" />


 <link rel="stylesheet" href="stylesheet.css" type="text/css" />

        </head>
 <body>

<div id="header"><h1>Main header content</h1></div>
<div id="main">
<div id="left"><h2>Secondary Main Header content</h2>

 

</div>
<div id="right">Other Links</div>
</div>

</body>
</html>

This template will be compliant and validate under current XHTML and CSS standards. Although it will display best in newer browsers it will be backwards compatible so it displays pretty good in older browsers too like Netscape 4.x

You notice we have included import and META tags for search engines that support them, and for those who don't, main content tag in is an h1 element right under BODY element.

We use an external stylesheet so Search Engines don't have to wade through data that doesn't mean anything to them.

Right under h2 element will be main content of page. Other links will be lower down on page in markup, but will appear in a right-hand navigational menu.

You will notice at this point there isn't any links to graphics in html. To keep presentation separate from content, these elements are in CSS file.

So CSS properties for body tag (using this example) are

body {
      background: #C0C0C0;
      background-image: url("images/x036.jpg");
      background-repeat: repeat;

 }

This just provides main background color and background we wish to tile.

Then in CSS for id header, we have:

#header {
  border :  black solid 2px;
         width: 746px;
         margin : auto;
  height : 100px;
  border-collapse : collapse;
  background-image: url("images/header.jpg");
       }

By placing this in a div, setting a width for it and setting margin to 0 it will center header information. You will also notice I've set a background image and set a border that will surround content to give it more of a template feel. This has effect of taking place of using TABLES for layout purposes. You will see more about this as we progress through this tutorial.

Next we want to take a look at "div id=main" because this is a container for two other div elements; "div id=left" and "div id=right"

#left will be main content area and #right will be navigational menu. It is constructed this way so first content search engines will index is closer to top of page and under our h1 header. All we really want to do with #main container div is to set up margins and width. This is it:

#main { margin: auto;
        width: 750px;
      }

Again, margin is set to auto and with width locked to 750px it has effect of mimicking a centered TABLE. This wouldn't be so important if everyone was using same monitor resolution, set to 800x600, but recent reports show that almost half of online population is using 1028x768 or greater, since monitors larger then 17" became popular. So we want to center content so those with a larger display resolution aren't looking at a big empty space to their right.

Now we have our main container set, let's look at div id="left"

#left {
 border : black solid 2px;
 border-top: 0;
 width: 599px;
 float : left;
 background-color: White;
}

Over-all it has our border set to 2px; but since we already have a border at top from header div... we set top border to 0 so it doesn't look like we have an overly thick border at top. We have also told this "div" that we want it to float left. It will move as far left as #main will allow it.

only other thing to note about this #left is background color has been set to white, so our main content area can have black text on a white background.

Now let's look at #right div:

#right {
 border :  black solid 2px;
        border-top: 0;
 border-left: 0;
 width: 145px;
 height : 300px;
 float: right;
 background-image: url("images/right-background.gif");
 background-repeat: repeat;

}

You will see here that border top and left has been set to 0 so we don't have a border with a double thickness, but what is really important to note here is widths of two divs. One is set to 599px and other is set to 145px, which adds up to 744 pixels and not 750. But we have to include widths of our borders here. We have a 2px border on left, another which separates two columns, and another on right. Now we have filled 750 px width that we set in #main. If these are not exact, then you will find your two columns displaying funny... for example, your links column will hang below main content area, giving page a very unusual look.

I've created a template for this tutorial, and added an article to it. You can view it here:
http://homebusiness-websites.com/tutorial

You can click images at bottom of page to check and see if Xhtml and CSS validates.

Next week will be part II

Use the form at the top of this page to subscribe so you don't miss it.

Network with an Internet Marketing Specialist
-- Posted by Steve on Tuesday, October 12 2004

Kevin Robb, Internet Marketing Specialist, has a long history in the world of business. He has over 25 years experience in the field of Sales and Marketing, promoting capital plant and equipment in the automotive industry.

Kevin has been a high achiever, the recipient of many awards from David Foreman & Associates for excellence and he is highly regarded by his peers.

During this time Kevin has trained and mentors a considerable number of sales representatives, many have gone on and excelled in their field.

Kevin has opened a new forum where you can network and discuss various marketing issues at:
http://www.ebusinessformula.com/forum

Let's give Kevin some support. I want each of you to drop by and say hello.

Printer Friendly Pages
-- Posted by Steve on Tuesday, October 12 2004

Yes, I am sure you have seen this on a lot of the bigger news sites etc. Just about every site offers a printer friendly version of the page you are reading.

What this says is that if a prospect can keep your information on their desktop for further study, this gives him or her a  greater opportunity to be able to order from you providing the printed page has your contact information on it.

You want to make sure that your fax, phone number(s) and address is on every page you write and put on the web. Especially if you're going to give them the opportunity to print your information

Part of the inspiration I received to write this article stems from discussions I have had with associates and customers about abandoned shopping carts. You know - these are the folks who were going to buy from you but for some unknown reason backed out of the ordering process at the last minute. Why?

There are several opinions as to why.  I don't really care why. The fact is - they backed out and you lost the sale. But even if they backed out, it doesn't mean you have to lose the sale. Not, if they already have a copy of your sales letter with your contact information on it.

A few years ago most browsers did not print web pages well at all. But newer browsers are capable of printing really well. The problem is you have the web sales copy buried in the design of your site. It is surrounded by flashing animated images, banners, buttons, colors and all manners of web page stuff that is not going to print well at all.

So this is what we need to accomplish:

 We need to separate the sales copy from the web display properties and page, to present something to the prospect that would print well.

 We need to include a small javascript that will be a link they can click on to print this page.

 We need to include with the sales copy that gets printed off, our contact information so they can call or fax, and a order form suitable for mailing or faxing.

 We also want to keep the expense of this project down because we don't want to be writing the same copy twice - once to fit in with the theme of the site, and once on plain white background with black text for printing.

For those of you with professional hosting on either *nix flavoured servers or NT servers, you are more then likely able to use a simple language called XSSI. This means Extended Server Side Includes and is developed from SSI but now allows the use of conditional statements such as "if", "elif," else, etc.

So if the main article on your page has been added to the template as an included file, you can easily separate it from the rest of the template. Suppose the file name of the article you are looking at is called "smallbiz.shtml"

Most servers parse files with the "*.shtml" extension for SSI commands. This means that the commands are carried out before the content is sent to the users browser. This is why you won't see the coding if you use your browser's "view source."

At the very bottom of the document you see a little icon for a printer and a link that invites you to click for a printer friendly copy. In this example, the included file in "smallbiz.shtml" is called "smallbiz_bodycopy.shtml" so that when we click that link it can either open in a javascript window, or you can use the link attribute TARGET="_blank" top open a new copy of the browser with the printer friendly document loaded into it. This will exclude all the extraneous web page stuff you don't want printed

By using a little pre-planning we have buried some XSSI commands in this document that could not be executed when the file opened in "smallbiz.shtml". We execute these commands by having the document recognize a server variable such as the name of the document itself. Using a little code like this:

<!--#if expr="($DOCUMENT_NAME=/smallbiz_bodycopy.shtml/)" -->
           <!--#include FILE="js.js" -->
                   <!--#endif -->

What this is doing is including a little javascript that will be placed at the top of the window that will be a javascript link to print the page. All we are including with this file is:

<p ALIGN="center"><a href='javascript:;' onClick='window.print();return false'>Click Here to Print this page.</a>
You don't see this when the content was included in the template because the NAME of the document at that time was NOT "smallbiz_bodycopy.shtml" but was instead part of "smallbiz.shtml" so this Javascript link does not appear when the content is embedded with the regular document.

See? So it is possible to have any amount of content buried within the printer friendly version of the web page but not have it visible until they click the link which launches the main document into it's own window for printing.

As well, at the bottom of the document you could include a generic order form. That would appear in the page that gets printed off.

<!--#if expr="($DOCUMENT_NAME=/smallbiz_bodycopy.shtml/)" -->
<!--#include FILE="generic_order.html" -->
<!--#endif -->

I say "generic" when in fact you could include a custom order for each page, but then this creates more coding for yourself. A generic order form can be called in using a template file that is used for several web pages.

I know some of you might think that a generic form might not work for all products and this may be true. Then, Eaton's seemed to be able to do it for the thousands of items in their catalogue.

You could even swap online ordering info with off-line ordering info depending on how they view the document. You could also include special formatting with CSS (Style sheets) and swap out the files.

Absolute positioning for Search Engines
-- Posted by Steve on Tuesday, October 12 2004

    > How do you tell a spider to index the upper
    > part of a page and not the lower part?

No. You can't tell it to skip indexing the top of the page, but what you can do is use CSS, absolute positioning, to place text containing keywords at the top of your page, that is invisible to users, but visible to search engines.

Let's look at an example.

Look at these two pages and see if they LOOK any different: page1 and page2.

Page1:
http://homebusiness-websites.com/index.html

Page2:
http://homebusiness-websites.com/homebusiness-websites.html

    In any standards compliant browser they look the same.

Use your browser "view source" on page1 to see how far down you have to scroll before you get to any content. Then "view source" on page2 and you will see some keyword stuffing in a div tag that isn't visible to the user and isn't displayed in the browser. A search engine spider can see it though.

Using absolute positioning I've placed the content out of the range that the browser can display.

Did you happen to notice the meta tags for keywords and description? Google doesn't bother with these meta tags because they have been abused so much in the past. But there are other search engines beside Google. AltaVista, AllTheWeb and Teoma still take these tags into consideration, and there has just recently been launched (last week) two new META search engine crawlers that collect results from various sources and return what they deem the closest to your query. I forget the name of the first one, but the second one which I tried and like is clusty.com.

Clusty is a meta-search site, drawing its results from multiple engines and other information sources. Clustered-search technology does offer an innovative alternative for users wanting a different way to view results. Maybe it is a step ahead of the new MSN search engine. Likewise MSN added a technique for grouping, or clustering, search results by domain in order to make sure that users view results from a variety of domains rather than getting multiple Web pages from the same domain.

New search engines haven't been springing up so quickly the last couple of years since Google's World domination, but recently there are new ones emerging and I hear that some of Google's key people are quitting (maybe there is trouble brewing). As well, Microsoft is ready to give Google a "run for it's money" with its redeveloped MSN search. Justin Osmer, an MSN product manager, claims MSN Search has indexed more then 5 billion Web documents while Google's claim to fame is 6 billion documents.

Anyway, the point is — it is pretty hard to tell which way the train went by looking at its tracks so I wouldn't completely abandon meta tags yet.

Use XSSI to Publish A Weekly Schedule
-- Posted by Steve on Tuesday, October 5 2004

Let's assume you have sold access to a weekly course. People are logging on to your site for new instructions and lessons every day. Due to your schedule, you are finding it hard to keep the lessons updated and manage your other responsibilities. You want to have the the lessons for each day appear on the same page so you don't have to keep giving your students a different URL each day.

Or let's assume you have to publish a weekly schedule.

Or maybe... You want your site visitors to see a fresh list of articles every day when they visit your site.

In each of these cases the content could be prepared in advance, on a day when you have time, and then use XSSI to make sure the correct page loads on the correct day; regardless of whether it is a list of articles or lessons.

XSSI means Extended Server Side Includes.

The first thing you need to do is tell the server what day it is so it will know what page to load:

<!--#config timefmt="%A" -->
<!--#set var="weekday" value="${DATE_LOCAL}" -->

This gets the day, and stores it into a variable called "weekday."

<!--#if expr="'${weekday}' = 'Sunday'" -->
<!--#include file="sunday.inc" -->

So... if it is Sunday, this tells the server to load the "sunday.inc" (included file fragment) into your lesson plan page. What if it isn't Sunday? What if it is Monday?

<!--#elif expr="'${weekday}' = 'Monday'" -->
<!--#include file="monday.inc" -->

Notice the change from "#if" to "#elif" -- this means if the condition isn't met, and it isn't Sunday... then if it is Monday... load "monday.inc"

Let's continue:

<!--#elif expr="'${weekday}' = 'Tuesday'" -->
<!--#include file="tueday.inc" -->

<!--#elif expr="'${weekday}' = 'Wednesday'" -->
<!--#include file="wednesday.inc" -->

<!--#elif expr="'${weekday}' = 'Thursday'" -->
<!--#include file="thursday.inc" -->

<!--#elif expr="'${weekday}' = 'Friday'" -->
<!--#include file="friday.inc" -->

<!--#elif expr="'${weekday}' = 'Saturday'" -->
<!--#include file="saturday.inc" -->

There are only seven days in the week so we need to tell the server that we have reached the end of the conditional statements so the last line of code is:

<!--#endif -->

Now you can do your lessons plans when you have time, upload them and let the server deliver the content on the day your site needs to be updated.

Charset
-- Posted by Steve on Tuesday, October 5 2004

 Two weeks ago I was browsing a discussion forum. Someone was complaining about weird characters appearing on a particular webpage. I clicked on the link to have a look... but guess what? No weird characters. How come I wasn't seeing them if he was?

Charsets are the official names for character sets that may be used in the Internet and may be referred to in Internet documentation.  These names are commonly called US-ASCII or simply ASCII. There are three ways this can be transmitted to the browser:

   1.  The server sends the information with the HTTP header.
   2. The served page declares the encoding in a meta statement.
   3. An XHTML page declares the encoding in the XML declaration

Without really knowing it, we are relying on our web servers global configuration to send the right character encoding to the browser, but it doesn't always happen that way.

If you are using ASCII special character it is a good idea to include a meta tag in the <head></head> of the web document that looks like this:
<meta http-equiv="content-type" content="text/html; charset=utf-8" />

Another common way of expressing almost the same thing is:
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />

What's the difference?

ISO-8859-1 is an older method of 8-bit encoding and the UTF-8 is a newer construct which uses two bytes to represent one character which give us a little bit more flexibility.

Either one will work fine for you, but the default for XML (which XHTML is a sub-set of) is UTF-8. So in "keeping with the times" we might as well use UTF-8.

You see a lot of people who want to put a long dash between two words using a double hyphen (--). You don't need to. The next time you want to do this, try "Alt+0151" and you have just used an extended ASCII encoded character. But there at lots of other ones. Your computer probably has a little program installed called a "Character Map" which shows you the extended ASCII characters and how to write them.

Using the proper META tag ensures these characters display properly to your site visitors, and makes sure they are not seeing "weird characters" where they aren't supposed to.

Build Your Website with a Plan
-- Posted by Steve on Monday, September 27 2004

Unless you're building your very first website, and it is only a handful of pages, you know what it is like to say "Gee... why didn't I plan for this from the start?"

Now you have 30-50+ webpages that you have to edit. You're wishing you had a shortcut...

You can plan for shortcuts when you build the website.

I don't know how many times I've been asked to work on a site that contains a collection of *.htm files and *.html files. Yes, you've heard it doesn't matter -- both extensions are OK. Sure they are... but you just lost a shortcut you could use later by using both, *.htm and *.html file extensions.

Let's look at an example...

Suppose all the webpages on your site have the html extension. A year later you park another domain name on your account, and your hosting account doesn't support multiple names. Luckily for you, you found a script that will do it for you... but it is a CGI script and has to be loaded as soon as someone arrives at your site. The worse part is you have been promoting www.yourdomain.com for a year, and by default most servers are set to look for and load either index.htm or index.html in your root directory.

Cool! Now you have use for an htm file. You can add this to your .htaccess file:
AddType application/x-httpd-cgi .htm

Then when someone clicks on www.yourdomain.com your CGI script will execute.

Of course there may be someone who has bookmarked your homepage as:
www.yourdomain.com/index.html

...and you had to remove the index.html so the index.htm (CGI script) would execute.

You can add another line to your .htaccess file:
ErrorDocument 404 http://yourdomain.com/index1.html

...so that anyone who tries to access your site through the index.html file gets automatically re-directed to the new index file which could be called index1.html

And of course one of my favorites...

If I'm building a large site and have a feeling that the client hasn't planned real well, I'll add this to my .htaccess file:

AddType text/html .html
AddHandler server-parsed .html

This lets me use SSI in html files. This one can be added anytime, but if you build your menu into an included file, and you change it 20-30 files later, you don't have to re-edit all of those files.

Plan for allowing shortcuts when you build the site, and you won't be looking at a lot of work or expense later.

How to Syndicate RSS Content
-- Posted by Steve on Monday, September 27 2004

Since most blogging programs create RSS feeds, you can take advantage of this by using their headlines to create content for your site. Naturally you would have to ask permission for this but most folks don't mind a little free advertising. Many sites offer their feeds to syndicate, but some folks who are jumping on the blog bandwagon don't know how to tell you how to syndicate their content. This article will show you how you can use their headlines or offer others yours.

I wrote a similar article two years ago called "How to Setup Coranto so Other Websites Can Display Your Headlines" and if you would like to review it you will see most of the instructions on how to work with "RSS File Advanced" which is Perl/CGI script you would need to install. If you read that you will get a working knowledge of how to use the script. You can read the article here:
http://homebusiness-websites.com/article_blog_coranto_setup.html

If you have read through that then to grab another sites' feed you have to edit line 65

Starting on line 65 you will see:

%services =  (
   'eWeek'             => "webattack.com/webattack.xml\teWeek",
 );

I made a minor mistake here and called this eWeek, and this isn't an eWeek newsfeed. That doesn't matter here. What matters is the 'eweek' in single quotation marks, will be the name of the javascript file. I created a blank file using Notepad and saved it as eWeek.js, and uploaded it to the directory where I keep my xml files. I set the permissions of this file to 777 because the RSS fetcher script will need to write the Javascript into this file.

Notice on the end of the file being called is : \teWeek"'
\t is Perl, that means to leave a space the width of a tab... which is followed by the name of the feed.

On line 44, this is where you tell the script where your files are stored:

# directory where data will be stored, chmod 777
$datdir = "/home/homebus/public_html/xml";


So if you have followed along here, you see we have set this up to pull in a newsfeed. I would save the script and upload it to your CGI bin with a unique name. For example... I called this file "eweek-rss.pl"

Set the permissions to be executable (755) then call it from your browser and watch what happens. It will take a minute or so to do the fetching. Once it is done, using a template of your website you can add a Javascript to call the headlines:

<SCRIPT LANGUAGE="JavaScript1.1" SRC='http://homebusiness-websites.com/xml/eWeek.js'></SCRIPT>

If you want more control over how this data is displayed in your html template, you can put it in a table. If you don't like the fonts being used by the script you can edit the table code in the Perl script.

You can follow this very same method to offer your blog headlines to others, or use it to pull in someone else's headlines. For each newsfeed you want to call, you will need to rename the CGI script and change the settings on line 65.

To display someone's headlines other then your own you will have to ask for the path to the XML file if you do not see an icon on their site that links to it.

If you would like to see the example (mistake and all) I created pulling in the newsfeed used in this example, visit:
http://homebusiness-websites.com/eWeek

How To Automate Requests For White Papers
-- Posted by Steve on Monday, September 20 2004

Here's the deal:

You want to generate more subscribers by offering some "white papers" or "special reports." Since you're going to set up a dozen or so, you don't want to hire a programmer to come in and re program your mailing list program to send out a dozen or so personalized messages that contain the link to the download or URL.

Actually, it might be better to not invoke the mailing list program at all. You want them to request the report, send them a personalized message and ADD them to your web based mailing program without having to handle all of the extra email addresses manually. Oh yes... you don't want to process individual emails either. You would prefer to receive NO email.

So you put a little form on your website that looks like this:

<form METHOD="POST" ACTION="recv_devel.php">
<b>Name:</b><br>
<input TYPE="TEXT" NAME="NAME" VALUE=""><br>
<b>E-mail:</b><br>
<input TYPE="TEXT" NAME="Email" VALUE=""><BR>
<INPUT TYPE="submit" VALUE="Submit">
</form>

Note that the action of the for is a call to a PHP page where the magic happens. Part of the great thing about FORMS and PHP is as soon as the form is submitted the variables are available in the next page for us to work with.

The first part of your new file might contain some acknowledgement for your prospect:

<h2>Thank you</h2>

<P>An email has been sent to you with instructions on how to
download the white paper.</P>

That's it! That's all they see. Even if they use their browsers "view source" assuming maybe they used a fake email address, they still won't get the URL. The URL is enclosed in PHP tags which is not available to the user from the "view source."

The next few lines on the page look like this:

<?

$outputstring = $Email."\n";

$fp = fopen("cgi-bin/mail_list.txt","a");
fwrite ($fp, $outputstring);
fclose($fp);

?>

Here we use three PHP functions fopen(), fwrite() and fclose()

The thing that is the MOST important to make sure you have is the "a" in the fopen() string. This is called a "file mode" and the "a" tells the script the file is being opened to append information to the end of the existing content. That means that each time we add a new email address to the file, it adds a new line and appends it to the end of the content in file. Nothing is over written or is the file altered in any other way.

Once the file has been opened by the script and it understands where in the file it is placing the information the fwrite() function write the email address to the file and then it is closed by fclose().

Now that we have the email address added to our mailing list we need to look after sending a personalized email to our prospect. Here is what the rest of the script will look like:

<?
$toaddress = "$Email";
$subject = "Your Special Report";

$feedback = "Thanks for requesting the special report. I am sure you will find it useful. If you have any questions please feel free to email me\n You can download your special report at

http://homebusiness-websites.com/special_report.pdf\n

Best Regards\n
Steve MacLellan\n";

$additional_headers = "From: steve@homebusiness-websites.com\n"
."Reply-To: steve@homebusiness-websites.com\n";

$mailcontent = "Hi ".$NAME."\n"
."Thank you:\n".$feedback."\n";

mail ($toaddress, $subject, $mailcontent, $additional_headers);
?>

There are a lot of other things that could have been added to this code to format the email better and add error checking to the script. But for the sake of brevity, and understanding the basics, it has been omitted. And if you click on the link for the special report... guess what? There isn't one. (he-he)

If you study the code it should help give you some ideas on how to go about implementing something like this. If you need to hire a programmer to write something a little more complete, send me an email and I can write it any way you want.


Powered by Coranto


| Home | Find more Blogs | Services | Products | Discussion | Articles |