We've had several people request the use of our Tell-A-Friend code. Here you go!
Here is the code.
<% @language="vbscript" %>
<% Sub Thanks() %>
<html>
<head>
<title>Thanks for referring ASPFree.com</title>
</head>
<body>
<h2 align="center">Your Friends at ASPFree.com thank you recommending our website!</h2>
<br>
<br>
</body>
</html>
<% End Sub %>
<% Sub IntroPage() %>
<html>
<head>
<title>Tell-A-Friend Script</title>
</head>
<body>
<form method="POST" action="tellfriend.asp" name="form1">
<h2 align="center">Tell your friends about ASPFree.com!</h2></center>
<center>
<br>
<br>
<table border="0" width="50%">
<tr>
<td width="38%"><b>Friends Email Address:</b></td>
<td width="62%"><input type="text" name="FriendsEmailAddress" size="40"></td>
</tr>
<tr>
<td colspan="2" width="100%"><center><i>Their email address, e.g. username@domain.com</i></center></td></tr>
<tr>
<td width="38%"><b>Your Email Address</b></td>
<td width="62%"><input type="text" name="YourEmailAddress" size="40"></td>
</tr>
<tr>
<td align="center" colspan="2" width="100%"><center><i>Your email address, e.g. username@domain.com</i></td>
</tr>
<tr>
<td width="38%"><b>Subject</b></td>
<td width="62%"><input type="text" name="Subject" size="40" value="Check out this page @ ASPFree.com"></td>
</tr>
<tr>
<td width="38%"><b>Comments</b></td>
<td width="62%"> </td>
</tr>
<tr>
<td colspan="2" width="100%"><textarea rows="6" name="comments" cols="58">I recommend you check out this page : <% = request("http_referer") %>
at http://www.ASPFree.com.
For ASPFree's forums-Quick, Easy to use, Searchable, Email when replyed to and more!!:
http://www.aspfree.com/forum/forums.aspx
</textarea> </td>
</tr>
</table>
<br>
<input type="submit" value="Send the Info!" name="btnSubmit"></center>
<br>
<br>
<blockquote>
This message sent to you from an associate as a service of ASPFree.com. For <br>
live ASP demos, downloads, source code, forums and more!
<a href="http://www.aspfree.com/Default.asp">http://www.aspfree.com</a><br><br>
<i>When the message is sent, you'll automatically be copied on the message. <br>
The text immediately above will be added to the message automatically,<br>
identifying the message as coming from ASPfree.com.</i><br>
</blockquote>
</form>
</body>
</html>
<% End Sub %>
<% Sub DoRecords() %>
<%
'Write to a database if so desired'dim strconn
'dim conn
'dim rs
'set conn = server.createobject("adodb.connection")
'conn.open strconn
'set rs = server.createobject("adodb.recordset")
'rs.open "PutYourTableNameHere", conn, 3, 3
'rs.addnew
'rs("name") = request("name")
'rs("emailaddress") = request("emailaddress")
'rs("phonenumber") = request("phonenumber")
'rs("comments") = request("comments")
'rs("DateSubmitted") = date()
'rs.update
'rs.close
'set rs = nothing
'conn.close
'set conn = nothing
strBody = "Your Friend has recommended you check out ASPFree.com: " & request("YourEmailaddress") & chr(10) & chr(10)
strBody = strBody & "Friends Comments: " & chr(10) & request("comments") & chr(10) & chr(10) & chr(10)
strBody = strBody & "This message sent to you from an associate as a service of ASPFree.com."
strBody = strBody & "For live ASP+, ASP demos, downloads, source code, forums and more! http://www.aspfree.com"
'Send a copy via an email
set objNewMail = server.CreateObject("CDONTS.NewMail")
objNewMail.From = request("YourEmailAddress")
objNewMail.To = request("FriendsEmailAddress")
objNewMail.CC = request("YourEmailAddress")
objNewMail.BCC = "webmaster@somedomain.com"
objNewMail.Subject = request("Subject")
objNewMail.Body = strBody
objNewMail.Send
set objNewMail = Nothing
response.redirect "tellfriend.asp?strMessage=Thanks"
End Sub%>
<%
If request("btnSubmit") = "" and request("strMessage") = "" Then
call IntroPage()
End If
If request("btnSubmit") = "Send the Info!" Then
call DoRecords()
End If
if request("strMessage") <> "" Then
call Thanks()
End If
%>
| DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware. |
More Database Code Articles
More By aspfree
developerWorks - FREE Tools! |
Join us for this on demand webcast to learn about developing complex systems more quickly and efficiently. We'll cover market drivers for developing, governing and reusing systems software assets and how you can develop system software assets with Rational Asset Manager. FREE! Go There Now!
|
|
|
|
Join this webcast to see how IBM Data Studio Developer and pureQuery can take the pain out of Java data access. uApplications developed using both Java and SQL have become a common requirement. Database connectivity using Java Database Connectivity (JDBC) to create an application is a multi-step tedious process, and tooling that covers both SQL and Java has been unavailable, until now. IBM Data Studio introduces the pureQuery platform: a high-performance, Java data access platform focused on simplifying the tasks of developing, managing, and optimizing database applications and services. FREE! Go There Now!
|
|
|
|
Learn how to implement a build management system that uses and extends your existing automation technologies. This tutorial shows, step-by-step, how to install and configure IBM Rational Build Forge to manage builds for Jakarta Tomcat from source code. FREE! Go There Now!
|
|
|
|
Learn how to do more with your reusable assets with the free Rational Asset Manager eKit. The eKit includes demos on how Rational Asset Manager tracks and audits your assets in order to utilize them for reuse. Plus you’ll find white papers and a Webcast that discuss the challenges of a Service Oriented Architecture and how Rational Asset Manager can provide quick and effective solutions. FREE! Go There Now!
|
|
|
|
Get a free trial download of the latest version of IBM Rational Performance Tester V7.0.1, a load and performance testing solution for teams concerned about the scalability of their Web-based applications. Combining multiple ease-of-use features with granular detail, Rational Performance Tester simplifies the test-creation, load-generation and data-collection processes that help teams ensure the ability of their applications to accommodate required user loads. FREE! Go There Now!
|
|
|
|
You can now evaluate IBM Rational Asset Manager V7.0 online without installing or configuring it on your own system! Rational Asset Manager helps create, modify, govern, find, and reuse any type of development assets, including SOA and systems development assets. Rational Asset Manager helps you reduce software development costs and improve quality by facilitating the reuse of all types of software development-related assets. Visit developerWorks to learn more about this product and register to explore its capabilities online. FREE! Go There Now!
|
|
|
|
Visit IBM developerWorks to try the IBM SOA Sandbox for process. The SOA Sandbox for process focuses on providing a trial environment with the necessary tooling and components required to gain a better understanding of business processes and how to best improve existing business processes to derive value quickly. FREE! Go There Now!
|
|
|
|
Whether you are creating new applications or modifying existing ones, managing integration of new components with traditional z/OS elements is a critical part of building and deploying modern applications. Listen to this webcast to see how IBM can help you optimize your development process using an IDE like Rational Developer for System z that integrates with management tools, such as ClearCase to manage your application development on mainframes. FREE! Go There Now!
|
|
|
|
In this webcast, IBM Rational will discuss the importance of Web application security and will share techniques and best practices to introduce application security testing into current QA processes including: understanding common security vulnerabilities and techniques to integrate security testing with defect tracking and remediation systems in an effort to safeguard sensitive online information. FREE! Go There Now!
|
|
|
|
Join this webcast to learn how IBM Rational's Functional Testing solution enables you to implement automation your way, at your pace, with your existing staff. In this webcast, you’ll learn how you can eliminate redundancy of manual test scripts, reduce errors, and increase test coverage through test automation. After this presentation you will understand how IBM Rational Functional Testing solution can streamline your manual testing and make test automation easily attainable. FREE! Go There Now!
|
|
|
|
All FREE IBM® developerWorks Tools! |