Real Estate Forums

Coding HTML, ASP, PHP, JAVA MYSQL and more. All coding questions should be asked here.

Reply
 
Thread Tools Display Modes
Old 07-30-2007, 03:42 AM
Mark_Smith Mark_Smith is offline
banned
 
Join Date: Mar 2007
Posts: 8
Mark_Smith is on a distinguished road
Default Adding Features to Your ASP Site

During the last few years the number of Web sites has grown dramatically, as well as the level of quality demanded from these sites. To succeed today, it's not enough to place some content on a static site. You need to have more and more features to attract new visitors and make them return again and again. Some of these features are not directly related to increasing the interest of your visitors and the level of traffic. Sometimes they are even not visible to the user, but are nonetheless crucial to getting your site's quality to the top.

In this article, I will try to show you how to implement some of today's most popular site features in ASP. Let's start with working examples of three commonly used features: a feedback form, a "recommend to a friend" feature and a 404 error reporter. The main function in the implementation of these three features is sending email from the ASP script. There are no built-in capabilities to send email from ASP, but there are lots of free and commercial components enabling you to do this. In this article, I'll use the JMail component available for free from www.dimac.net. You may use any other component available on your host; it shouldn't be difficult to adapt these examples to work on your site.

Feedback form

One of the most important elements of a great site is the ability to satisfy user needs, and the easiest way to know what your users need and want is by getting their feedback. From my own experience, I know that simply displaying your contact information doesn't guarantee much feedback. There are a variety of reasons why people might not send you email even if they want to tell you something: they're not browsing your site from their own computer; they don't have their email software properly configured; an email message tends to require some formal things like greetings and more; they don't want to give you their email but still have something important to say... Having a feedback form solves most of these problems, enabling you to get more information from your users and build a better site.

Implementation of feedback form in ASP is quite easy:
1) create HTML form
2) get fields
3) send email.

So let's start by creating basic HTML form (formatting skipped):

<FORM METHOD="POST" ACTION="sendmail.asp">
Name:<INPUT TYPE="TEXT" NAME="fromname" SIZE="32"><BR>
Email:<INPUT TYPE="TEXT" NAME="fromaddr" SIZE="32"><BR>
Subject:<INPUT TYPE="TEXT" NAME="subject" SIZE="50"><BR>
Message:<TEXTAREA NAME="body" COLS="40" ROWS="6"></TEXTAREA><BR>
<INPUT TYPE="SUBMIT" VALUE="Send"><INPUT TYPE="RESET"
VALUE="Clear">
</FORM>

And now we will get the fields from that form and send them to our email:

<%
Set jmail=Server.CreateObject("jmail.smtpmail")
jmail.ServerAddress="mail.company.com"
jmail.AddRecipient "webmaster@company.com"
jmail.Sender=Request.Form("fromaddr")
jmail.SenderName=Request.Form("fromname")
jmail.Subject=Request.Form("subject")
jmail.Body=Request.Form("body")
jmail.Execute
%>

This is the simplest implementation of a feedback form. You may use it on your site as is. However, I would recommend customizing it to be more universal. You can make the form accept not only the name and email of the sender, subject and body, but also allow a choice of email address of the recipient (you) so you may use it from various parts of your site or on various sites. In this manner, you will be able to add a select box (dropdown) to your HTML form, so your visitor may choose the theme of the message and send the message to a specific responsible person. To be even more universal, you may want the script to redirect to a specific "thank you" page after processing.

Now our HTML form will look something like this:

<FORM METHOD="POST" ACTION="sendmail.asp">
<INPUT TYPE="HIDDEN" NAME="redir" VALUE="/index.html">
Name:<INPUT TYPE="TEXT" NAME="fromname" SIZE="32"><BR>
Email:<INPUT TYPE="TEXT" NAME="fromaddr" SIZE="32"><BR>
Theme:
<SELECT NAME="toaddr" SIZE="1">
<OPTION VALUE="sales@company.com">Product sales
<OPTION VALUE="webmaster@company.com">Bugs, dead links, etc.
</SELECT><BR>
Subject:<INPUT TYPE="TEXT" NAME="subject" SIZE="50"><BR>
Message:<TEXTAREA NAME="body" COLS="40" ROWS="6"></TEXTAREA><BR>
<INPUT TYPE="SUBMIT" VALUE="Send"><INPUT TYPE="RESET"
VALUE="Clear">
</FORM>

And the processing script:

<%
Set jmail=Server.CreateObject("jmail.smtpmail")
jmail.ServerAddress="mail.company.com"
jmail.AddRecipient Request.Form("toaddr")
jmail.Sender=Request.Form("fromaddr")
jmail.SenderName=Request.Form("fromname")
jmail.Subject=Request.Form("subject")
jmail.Body=Request.Form("body")
jmail.Execute

Response.Redirect Request.Form("redir") %>

Note: Response.Redirect should be used before any content has been passed to the client.
Reply With Quote
Old 07-30-2007, 09:01 AM
VRI's Avatar
VRI VRI is offline
Uber Real Estate Webmaster
 
Join Date: May 2004
Location: Tampa Bay
Posts: 2,311
VRI will become famous soon enough
Default Re: Adding Features to Your ASP Site

HMMMM.... webreference.com/new/addasp.html
__________________
OverSite.US | A Unique Web Directory
Real Estate Directory | A regional listing of quality real estate related web sites.
Tampa Bay Fishing | Seeks references from the area resource pages of quality local sites.
Reply With Quote
Old 07-30-2007, 09:10 AM
Markz's Avatar
Markz Markz is offline
Uber Real Estate Webmaster
Recently blogged:
Dubai Property News
at my REW Blog. Claim your blog
 
Join Date: Jun 2007
Posts: 1,136
Markz is on a distinguished road
Default Re: Adding Features to Your ASP Site

Well caught....
__________________
| Dubai Property | Dubai Real Estate | Dubai Property Blog| Call +971 4 323 1018 Specialising in Dubai Property, The Springs, Meadows, Greens, Arabian Ranches, Dubai Marina, Burj Dubai, Jumeirah Islands, Emaar, Signature Villas, Garden Homes, Water Homes, JBR, The World, Nakheel, Business Bay, International City and more.
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

For our members

Main Sections

IDX Coverage Areas

Spiders Welcome

All times are GMT -7. The time now is 05:13 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.