Athmaus
10-12-2004, 06:19 PM
I have this login that i created. On the sign in process i need to make sure
that no one has already signed up using that certain email or that unique
cnumber.
Ive tried this line:
Set objRS = verify.execute("SELECT id FROM logmein WHERE email='" & email &
"'") or ("', cnumber= '" & cnumber & "';")
than this:
Set objRS = verify.execute("SELECT id FROM logmein WHERE email='" & email &
"'", "' & or & '", "' cnumber= '" & cnumber & "';")
Anyone know what i did wrong?
javaNoobie
10-12-2004, 11:10 PM
"SELECT id FROM logmein WHERE email='" & email & "' OR cnumber= '" & cnumber & "';"
Athmaus
10-12-2004, 11:15 PM
same thing, i get this error:
Microsoft OLE DB Provider for SQL Server error '80040e14'
Incorrect syntax near the keyword 'cnumber'.
here is my full code minus the form's
<%
Function SendEmail()
Dim myMail
Set myMail = CreateObject("CDONTS.NewMail")
HTML = "<!DOCTYPE HTML PUBLIC ""-//IETF//DTD HTML//EN"">" & NL
HTML = HTML & "<html>"
HTML = HTML & "<head>"
HTML = HTML & "<title>Login Information</title>"
HTML = HTML & "</head>"
HTML = HTML & "<center><b>Login Information</b></center>"
HTML = HTML & "<br>Dear: " & Request.Form("fname") & " " &
Request.Form("lname")
HTML = HTML & "<br> <b>User Name: </b>" & Request.Form("email")
HTML = HTML & "<br> <b>Password: </b>" & Request.Form("password")
HTML = HTML & "</body>"
HTML = HTML & "</html>"
myMail.From = "login@aaa.com"
myMail.To = Request.Form("email")
myMail.Subject = "Login Information"
myMail.BodyFormat = 0
myMail.MailFormat = 0
myMail.Body = HTML
myMail.Send
End Function
%>
<%
Response.Expires = -1000 'Make sure the browser doesnt cache this page
Response.Buffer = True 'enables our response.redirect to work
If Request.Form("valuepassed") ="true" Then
CheckSignUpForm
Else
ShowSignUpForm
End If
Sub CheckSignUpForm
Dim myconn, verify, blnLoggedIn, first, last, email, cnumber, user, pass,
site, logged, objRS, information
Set verify = Server.CreateObject("ADODB.Connection")
verify.open = "Provider=SQLOLEDB.1;Password=xxx;Persist Security
Info=True;User ID=xxxx;Initial Catalog=xxx;Data Source=xxx"
first = Request.Form("fname")
last = Request.Form("lname")
email = Request.Form("email")
cnumber = Request.Form("cnumber")
'user = Request.Form("username")
pass = Request.Form("password")
site = 1
logged = 0
Set objRS = verify.execute("SELECT id FROM regfreeup WHERE email='" & email
& "'") or ("' cnumber = '" & cnumber & "';")
'Set objRS = verify.execute("SELECT id FROM logmein WHERE username='" &
user & "' OR cnumber ='" & cnumber & "';")
If objRS.EOF Then '''NO RECORDS MATCH. PROCEED WITH LOGIN CREATION
blnLoggedIn = False
information = "INSERT INTO logmein (cnumber, firstname, lastname, email,
pass, site, signup, logged) VALUES('" & cnumber & "', '" & first & "', '" &
last & "', '" & email & "', '" & pass & "', '" & site & "', '" & Now() & "',
'" & logged & "')"
Set Recordset = verify.execute(information)
SendEmail()
Response.Redirect "http://www.yahoo.com"
Else
Response.Redirect "http://www.google.com"
End If
verify.close
set verify = nothing
ShowSignUpForm
End Sub
%>
<% Sub ShowSignUpForm %>
javaNoobie
10-12-2004, 11:24 PM
Set objRS = verify.execute("SELECT id FROM regfreeup WHERE email='" & email & "' OR cnumber='" & cnumber & "';")
Athmaus
10-12-2004, 11:34 PM
yeah i knew to add in the stuff that was left out
but i finally found the problem with the code! There was a typo on one of the cnumber!!! pisses me off i spent all that time (well off and on since i posted it) and it was a typo!!! -_-
javaNoobie
10-12-2004, 11:38 PM
Yea.. hate it when you spend alot of time on an error only to find that it was a typo.:mad:
Athmaus
10-12-2004, 11:38 PM
thanks for your help though!!! :)