Forums

This topic is locked

i need some help Pleaaase...

Posted 18 Feb 2002 23:45:31
1
has voted
18 Feb 2002 23:45:31 Serge Chabert posted:
Hi guys,

I have a problem with email confirmation once the user has filled the register form page. here is the message that appears :

Microsoft VBScript compilation error '800a0401'

Expected end of statement

/iisHelp/common/500-100.asp, line 11

Dim objASPError, blnErrorWritten, strServername, strServerIP, strRemoteIP Dim strMethod, lngPos, datNow, strQueryString, strURL
--------------------------------------------------------------------------^
Microsoft VBScript runtime error '800a01a8'

Object required: 'rsSubmitConfirm'

/registersucces1.asp, line 15


The register page is as follow :

<%@LANGUAGE="VBSCRIPT"%>
<% Session("svUsername" = Request.Form("Username" %>
<!--#include file="Connections/serge.asp" -->
<%
' *** Edit Operations: declare variables

MM_editAction = CStr(Request("URL")
If (Request.QueryString <> "" Then
MM_editAction = MM_editAction & "?" & Request.QueryString
End If

' boolean to abort record edit
MM_abortEdit = false

' query string to execute
MM_editQuery = ""
%>
<%
' *** Redirect if username exists
MM_flag="MM_insert"
If (CStr(Request(MM_flag)) <> "" Then
MM_dupKeyRedirect="registerfailure.asp"
MM_rsKeyConnection=MM_serge_STRING
MM_dupKeyUsernameValue = CStr(Request.Form("Username")
MM_dupKeySQL="SELECT Username FROM users WHERE Username='" & MM_dupKeyUsernameValue & "'"
MM_adodbRecordset="ADODB.Recordset"
set MM_rsKey=Server.CreateObject(MM_adodbRecordset)
MM_rsKey.ActiveConnection=MM_rsKeyConnection
MM_rsKey.Source=MM_dupKeySQL
MM_rsKey.CursorType=0
MM_rsKey.CursorLocation=2
MM_rsKey.LockType=3
MM_rsKey.Open
If Not MM_rsKey.EOF Or Not MM_rsKey.BOF Then
' the username was found - can not add the requested username
MM_qsChar = "?"
If (InStr(1,MM_dupKeyRedirect,"?" >= 1) Then MM_qsChar = "&"
MM_dupKeyRedirect = MM_dupKeyRedirect & MM_qsChar & "requsername=" & MM_dupKeyUsernameValue
Response.Redirect(MM_dupKeyRedirect)
End If
MM_rsKey.Close
End If
%>
<%
' *** Insert Record: set variables

If (CStr(Request("MM_insert") <> "" Then

MM_editConnection = MM_serge_STRING
MM_editTable = "users"
MM_editRedirectUrl = "registersucces1.asp"
MM_fieldsStr = "Firstname|value|Lastname|value|Username|value|Password|value|Email|value|Phone|value|Address|value|Zipcode|value|City|value|State|value|Country|value|Profession|value|Website|value|comments|value"
MM_columnsStr = "Firstname|',none,''|Lastname|',none,''|Username|',none,''|Password|',none,''|Email|',none,''|Phone|',none,''|Address|',none,''|Zipcode|',none,''|City|',none,''|State|',none,''|Country|',none,''|Profession|',none,''|Website|',none,''|comments|',none,''"

' create the MM_fields and MM_columns arrays
MM_fields = Split(MM_fieldsStr, "|"
MM_columns = Split(MM_columnsStr, "|"

' set the form values
For i = LBound(MM_fields) To UBound(MM_fields) Step 2
MM_fields(i+1) = CStr(Request.Form(MM_fields(i)))
Next

' append the query string to the redirect URL
If (MM_editRedirectUrl <> "" And Request.QueryString <> "" Then
If (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0 And Request.QueryString <> "" Then
MM_editRedirectUrl = MM_editRedirectUrl & "?" & Request.QueryString
Else
MM_editRedirectUrl = MM_editRedirectUrl & "&" & Request.QueryString
End If
End If

End If
%>
<%
' *** Insert Record: construct a sql insert statement and execute it

If (CStr(Request("MM_insert") <> "" Then

' create the sql insert statement
MM_tableValues = ""
MM_dbValues = ""
For i = LBound(MM_fields) To UBound(MM_fields) Step 2
FormVal = MM_fields(i+1)
MM_typeArray = Split(MM_columns(i+1),","
Delim = MM_typeArray(0)
If (Delim = "none" Then Delim = ""
AltVal = MM_typeArray(1)
If (AltVal = "none" Then AltVal = ""
EmptyVal = MM_typeArray(2)
If (EmptyVal = "none" Then EmptyVal = ""
If (FormVal = "" Then
FormVal = EmptyVal
Else
If (AltVal <> "" Then
FormVal = AltVal
ElseIf (Delim = "'" Then ' escape quotes
FormVal = "'" & Replace(FormVal,"'","''" & "'"
Else
FormVal = Delim + FormVal + Delim
End If
End If
If (i <> LBound(MM_fields)) Then
MM_tableValues = MM_tableValues & ","
MM_dbValues = MM_dbValues & ","
End if
MM_tableValues = MM_tableValues & MM_columns(i)
MM_dbValues = MM_dbValues & FormVal
Next
MM_editQuery = "insert into " & MM_editTable & " (" & MM_tableValues & " values (" & MM_dbValues & ""

If (Not MM_abortEdit) Then
' execute the insert
Set MM_editCmd = Server.CreateObject("ADODB.Command"
MM_editCmd.ActiveConnection = MM_editConnection
MM_editCmd.CommandText = MM_editQuery
MM_editCmd.Execute
MM_editCmd.ActiveConnection.Close

If (MM_editRedirectUrl <> "" Then
Response.Redirect(MM_editRedirectUrl)
End If
End If

End If
%>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<p> </p>
<table width="36%" align="center">
<tr>
<td> 
<form method="POST" action="<%=MM_editAction%>" name="form1">
<table align="center">
<tr valign="baseline">
<td nowrap align="right">Firstname:</td>
<td>
<input type="text" name="Firstname" value="" size="32">
</td>
</tr>
<tr valign="baseline">
<td nowrap align="right">Lastname:</td>
<td>
<input type="text" name="Lastname" value="" size="32">
</td>
</tr>
<tr valign="baseline">
<td nowrap align="right">Username:</td>
<td>
<input type="text" name="Username" value="" size="32">
</td>
</tr>
<tr valign="baseline">
<td nowrap align="right">Password:</td>
<td>
<input type="password" name="Password" value="" size="32">
</td>
</tr>
<tr valign="baseline">
<td nowrap align="right">Email:</td>
<td>
<input type="text" name="Email" value="" size="32">
</td>
</tr>
<tr valign="baseline">
<td nowrap align="right">Phone:</td>
<td>
<input type="text" name="Phone" value="" size="32">
</td>
</tr>
<tr valign="baseline">
<td nowrap align="right">Address:</td>
<td>
<input type="text" name="Address" value="" size="32">
</td>
</tr>
<tr valign="baseline">
<td nowrap align="right">Zipcode:</td>
<td>
<input type="text" name="Zipcode" value="" size="32">
</td>
</tr>
<tr valign="baseline">
<td nowrap align="right">City:</td>
<td>
<input type="text" name="City" value="" size="32">
</td>
</tr>
<tr valign="baseline">
<td nowrap align="right">State:</td>
<td>
<input type="text" name="State" value="" size="32">
</td>
</tr>
<tr valign="baseline">
<td nowrap align="right">Country:</td>
<td>
<input type="text" name="Country" value="" size="32">
</td>
</tr>
<tr valign="baseline">
<td nowrap align="right">Profession:</td>
<td>
<input type="text" name="Profession" value="" size="32">
</td>
</tr>
<tr valign="baseline">
<td nowrap align="right">Website:</td>
<td>
<input type="text" name="Website" value="" size="32">
</td>
</tr>
<tr valign="baseline">
<td nowrap align="right">Comments:</td>
<td>
<input type="text" name="comments" value="" size="32">
</td>
</tr>
<tr valign="baseline">
<td nowrap align="right"> </td>
<td>
<input type="submit" value="Insert Record">
</td>
</tr>
</table>
<input type="hidden" name="MM_insert" value="true">
</form>
<p> </p>
</td>
</tr>
</table>
</body>
</html>


AND THE CONFIRMATION PAGE WHICH WOULD THEORETICALLY TRIGGER THE EMAIL CONFIRMATION IS AS FOLLOW :

<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="Connections/serge.asp" -->
<%
Dim RssubmitConfirm__strUsername
RssubmitConfirm__strUsername = "xyz"
if (Session("svUsername" <> "" then RssubmitConfirm__strUsername = Session("svUsername"
%>
<%
Dim strRecipient
Dim strFirstname
Dim strLastname
Dim strUsername
Dim strPassword

strRecipient = rsSubmitConfirm.Fields.Item("Email".Value
strFirstName = rsSubmitConfirm.Fields.Item("Firstname".Value
strLastName = rsSubmitConfirm.Fields.Item("Lastlame".Value
strUserName = rsSubmitConfirm.Fields.Item("Username".Value
strPassword = rsSubmitConfirm.Fields.Item("Password".Value
%>

<%
Dim objCDO
Set objCDO = Server.CreateObject("CDONTS.NewMail"
objCDO.From = " "
objCDO.Subject = "Your Registration Details"
objCDO.Body = "<font face='arial' size ='3'>" &_
"hiya!" &strFirstName& "" &strLastName&_
"<br>" &_
"this is your email conformation from favouritesonline.com " &_
"<br>" &_
"here r your details:"&_
"<p>"&_
"username:"&strUsername&_
"<br>"&_
"password:"&strPassword&_
"<p>"&_
"go to <a href='www.pwks.net'>www.pwks.net</a> to log on..." &_
"<p>" &_
"cheers," &_
"<br>" &_
"the fantastic staff" &_
"<br>" &_
"pwks.net" &_
"</font>"
objCDO.send()
Set objCDO = Nothing
%>

<%
set RssubmitConfirm = Server.CreateObject("ADODB.Recordset"
RssubmitConfirm.ActiveConnection = MM_serge_STRING
RssubmitConfirm.Source = "SELECT * FROM users WHERE Username = '" + Replace(RssubmitConfirm__strUsername, "'", "''" + "'"
RssubmitConfirm.CursorType = 0
RssubmitConfirm.CursorLocation = 2
RssubmitConfirm.LockType = 3
RssubmitConfirm.Open()
RssubmitConfirm_numRows = 0
%>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<p>Congratulation, <%=(RssubmitConfirm.Fields.Item("Firstname".Value)%> <%=(RssubmitConfirm.Fields.Item("Lastname".Value)%> you have registered successfully !!!! </p>
<p>Your Username is <%=(RssubmitConfirm.Fields.Item("Username".Value)%><br>
Your Password is <%=(RssubmitConfirm.Fields.Item("Password".Value)%></p>
<p>You are now a registered member.</p>
</body>
</html>
<%
RssubmitConfirm.Close()
%>

Can anybody help me please, i am at a loss.

thanks.


Reply to this topic