Chapter 16: Where To Now?

Google

Returning the user to another page

I use this technique in the script that operates my ezine directory. A number of ezine publishers have listed their ezines in my directory. When they joined, they were given customized links. Each of these links contains an item in the query string that serves as a return path. Once a visitor has finished using the Quick-Subscribe form, they are sent to the page named in this return path. Here's an example of URL with a return path given in a query string:

http://www.mysite.com/a_script.php?return_path=http://relay101.listbot.com

Within the script, this is parsed and the URL is assigned to a variable called $return_path. That code looks like this:

$return_path="http://relay101.listbot.com";

Whenever the script calls itself or calls decode.php the variable is passed along with the call. That way it's always available when the script finally finishes and it's time to send the visitor back home. That is done with this line:

header("Location: $return_path");

The return path may contain a query string or extra path information if you need to pass things to the page being displayed. The "header" function tells the visitor's browser to load the page located at that URL. You can use this method anytime you want the user to continue automatically to another page after your script has finished.

Tip: This method is great for serving up a Thank-You page. You can update this page whenever you want, without having to edit the script. The script only needs to know where the page is located. Such pages should be displayed any time visitors do what you wanted them to do - buy something, subscribe to something, etc. It's an automated response but it's still a part of good CUSTOMER SERVICE.

And speaking of customer service, it's always a good idea to send your customer some followup emails that add value to your product or service. Use the personalization techniques and the methods presented in Chapter 12 to make the customer feel special. Don't overdo it, though. Also, be sure to either let them know to expect some followup messages or use a double-optin autoresponder. You can customize the autoresponder messages using the mail-merge functions of any good autoresponder service. I use and recommend Aweber.com


Serving up a custom Web page

When your script takes input from the user and possibly also from a database, you can create a new page whose content will be different every time. The mechanics of doing this are explained in the next chapter but I want you to start thinking of some of the ways this could be useful. A very simple example (on the surface, at least) is what happens when you use a search engine. It retrieves the info you asked for and displays it on one or more pages. These pages are created at the time you ask for the data. They present it in a list that contains page titles, descriptions and links for each of the relevant pages.

Now suppose you have an online catalog with all your product descriptions, prices, stock numbers and availability stored in a database. A customer is interested in only certain products or groups of products. He or she fills in a search form and is shown a page that contains the details about his or her product selections.

Here's another example: Suppose you have a form that asks people a few survey questions. After the data is tabulated, a request is sent to the database to get an up-to-the-minute summary of the survey results. These results are displayed immediately.

The results from the database can be plugged into Web page elements and used to construct a customized page (or pages). If there are more results than can be shown on one page, links to the next page and previous page can be provided. All this fancy automation can give your customers the perception that your site is "user friendly." That's a good thing.

Refer to Chapter 14: Working with Databases, to see how to get information from a database. Once your script has that information stored in local variables, you can build a page with them and display it on the visitor's screen.

Chapter 17 will provide more details on how this is done.

Do the work once (writing the script), keep the content fresh (update the database) and let the server do most of the work. You'll give customers most of the help they need making buying decisions without having to do very much of the work personally. Make a contact phone number and email address available for those questions that will need your expert help. Make the most of your valuable time.

Previous Page   Table of Contents   Next Page

Copyright © 2004 Steve Humphrey