WebRef Update: Featured Article: Adding Features to Your ASP Site | 2 | WebReference

WebRef Update: Featured Article: Adding Features to Your ASP Site | 2


Adding Features to Your ASP Site

Recommend To a Friend

So you've managed to build a really useful site. Now you need to start building traffic. One of the most powerful ways of attracting new visitors is a recommendation from someone they know and trust - a friend. But no matter how good your site is, people are often still too hurried (or lazy) to start their mailer and send some recommendations to their friends. This is where the "Recommend To a Friend" feature comes into the game. This feature allows your satisfied visitor to recommend your site to a friend without having to do something extraordinary and without leaving your site. He/she just fills in his/her name and email address, name and email address of the friend and click a button.

The implementation of this feature is not much different from the implementation of the feedback form. Just collect the needed information and send the email.

<FORM METHOD="POST" ACTION="recommend.asp"> Your name:<INPUT TYPE="TEXT" NAME="fromname" SIZE="32"><BR> Your email:<INPUT TYPE="TEXT" NAME="fromaddr" SIZE="32"><BR> Friends name:<INPUT TYPE="TEXT" NAME="toname" SIZE="32"><BR> Friends email:<INPUT TYPE="TEXT" NAME="toaddr" SIZE="32"><BR> <INPUT TYPE="SUBMIT" VALUE="Send"><INPUT TYPE="RESET" VALUE="Clear"> </FORM>

And the processing script (recommend.asp):

<% Set jmail=Server.CreateObject("jmail.smtpmail") jmail.ServerAddress="mail.company.com" jmail.AddRecipientEx Request.Form("toaddr"),Request.Form("toname") jmail.Sender=Request.Form("fromaddr") jmail.SenderName=Request.Form("fromname") jmail.Body="Dear " & Request.Form("toname") & CHR(10) & CHR(10) & _ Request.Form("fromname") & " recommends you to visit " &_ "Company site at www.company.com " &_ "We have lots of useful information." jmail.Execute %>

You may want to allow for additional text to be added by the visitor, but weigh the fact that this could potentially be used to send inappropriate mail from your Web site.

404 Error Reporter

So things are starting to get rolling - your site has some traffic, you've submitted to lots of search engine and indexes, and there are finally other sites linking to yours. Inevitably, there will be some bad links among those. When a browser requests a non- existent page from your Web server, it receives 404 "page not found" error in response. Many servers can be configured to display a customized error page to be shown to your wayward visitor. You may use this page to let the visitor know that the page he requested doesn't exist and ask him to report the problem to the Webmaster of the site he came from. Now, how many of the visitors will actually do that? I would guess that the number is not much greater than 0.

You can analyze your logs to find out where are the bad requests coming from, but when you have a high-traffic site, downloading and analyzing logs can be a big pain. The easiest and fastest way is to make the error page to send you email with referrer and error information. To accomplish this, just add few lines of code to your custom 404 page (assuming that this page can include ASP):

<% Set jmail=Server.CreateObject("jmail.smtpmail") jmail.ServerAddress="mail.company.com" jmail.AddRecipient "webmaster@company.com" jmail.Sender="badlinkreporter@company.com" jmail.Subject="Bad Link Report" jmail.Body="Bad link to our site at " & _ Request.ServerVariables("HTTP_REFERER") jmail.Execute %>

Conclusion

By adding the features described above, you can spice up your site and make it more powerful. It's important to remember, however, that it's not the latest and greatest bells and whistles make your site sell but high quality content. So while adding new tools and features to your site, don't forget about creating new interesting content - it's the main reason why users visit for the first time and why they return later.

About the Author:

Alan Mendelevich lives in Lithuania, and currently spends most of his time working on ArticleCentral.com. He and the rest of ArticleCentral "work virtually around the clock monitoring hundreds of Web development related sites and listing newest resources in an easy to use categorized catalog. Every article of significant importance to the Webmaster and Web developer community is listed here the very same day it is released."

You can reach Alan at: alan@articlecentral.com or www.articlecentral.com.

Previous: Feedback Form

This article originally appeared in the January 27, 2000 edition of the WebReference Update Newsletter.

http://www.internet.com

Comments are welcome
Written by Alan Mendelevich and

Revised: May 10, 2000

URL: http://webreference.com/new/addasp2.html