hi,
hope this helps:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<%
'------------------this is an if statment for postback--------------------
val = request.form("val")
if val = "" then
'-----------------this is the form--------------------------------------
%>
<form action="thankyou.asp" method="get">
<table width="90%" border="0" cellspacing="0" cellpadding="4">
<tr>
<td>Name:</td>
<td><input name="t1" type="text" id="t1"></td>
</tr>
<tr>
<td>Email:</td>
<td><input name="t2" type="text" id="t2"></td>
</tr>
<tr>
<td>Password:</td>
<td><input name="Password" type="password" id="Password"></td>
</tr>
<tr>
<td>Message:</td>
<td><textarea name="sl" id="sl"></textarea></td>
</tr>
<tr>
<td> </td>
<td><input type="submit" name="Submit" value="Submit">
<input name="val" type="hidden" id="val" value="yes"></td>
</tr>
</table>
</form>
<%
'----------------if the form has been submitted to its self then run this code-------------------
else
'--------------------request the form elements and write to variables----------------------
t1 = Request.Form("t1")
t2 = Request.Form("t2")
st = Request.Form("s1")
yourpassword = request.form("password")
Dim ObjMail
'-------------------setup the CDONTS email object-------------------------------------
Set ObjMail = Server.CreateObject("CDONTS.NewMail")
'------------------------Set the email elements------------------------------
ObjMail.To = ""&t2&""
ObjMail.CC = ""&t2&""
ObjMail.From = "mybox@aol.com"
ObjMail.Subject = "You have registered"
thebody = "Name:"&t1&"" & vbcrlf
'----------------create the body of the message------------------------
thebody = thebody & "Email: "&t2&"" & vbclf
thebody = thebody & "Subject: "&t3&""
ObjMail.Body = thebody
'----------------------send the message-----------------------------------
ObjMail.Send
Set ObjMail = Nothing
'---------------------insert the information intot he database------------------------
sqltext = "INSERT INTO tblMembers (MemberName, MemberPassword "
sqltext = sqltext & " VALUES ("&t1&", "&yourpassword&")"
set RS = yourdatasource.Execute(sqltext)
set RS = nothing
'---------------------insert your thankyou message here------------------
%>
<table width="90%" border="0" cellspacing="0" cellpadding="4">
<tr>
<td>Thank you <%=t1%></td>
</tr>
</table>
<%
'----------------------end if the if statement----------------------------
end if
%>
----------------------------------
Bookmarks