Code:
<%
team_name = request.form("team_name")
capfname = Request.Form("cap_fname")
caplname = Request.Form("cap_lname")
address1 = Request.Form("address1")
address2 = Request.Form("address2")
city = Request.Form("city")
state = Request.Form("state")
zip = Request.Form("zip")
phone = Request.Form("phone")
email = Request.Form("email")
ataNum = Request.Form("ataNum")
ataAvg = Request.Form("ataAvg")
ataYard = Request.Form("ataYard")
%>
<%
team_name = request.form("team_name")
capfname = Request.Form("cap_fname")
caplname = Request.Form("cap_lname")
address1 = Request.Form("address1")
address2 = Request.Form("address2")
city = Request.Form("city")
state = Request.Form("state")
zip = Request.Form("zip")
phone = Request.Form("phone")
email = Request.Form("email")
ataNum = Request.Form("ataNum")
ataAvg = Request.Form("ataAvg")
ataYard = Request.Form("ataYard")
%>
<%
'if problem, continue without throwing error code
'take this out to receive debug msgs
'on error resume next
'Dim Connect to SQL Server Str
Dim connection, sSQL, sConnString, oRS, oConn
Dim connectstr, fieldname, tablename
Dim db_name, db_username, db_userpassword
Dim db_server
Dim checkConn,countrec,check_qry,check_connectstr,checkRS
'last chance to check for prop vals so strain off blank spaces in POST URL
team_name = left(Trim(Replace(Request.Form("team_name"),"'","''")),40)
capfname = left(Trim(Replace(Request.Form("cap_fname"),"'","''")),40)
caplname = left(Trim(Replace(Request.Form("cap_lname"),"'","''")),40)
address1 = left(Trim(Replace(Request.Form("address1"),"'","''")),40)
address2 = left(Trim(Replace(Request.Form("address2"),"'","''")),40)
city = left(Trim(Replace(Request.Form("city"),"'","''")),40)
state = left(Trim(Replace(Request.Form("state"),"'","''")),40)
zip = left(Trim(Replace(Request.Form("zip"),"'","''")),40)
phone = left(Trim(Replace(Request.Form("phone"),"'","''")),40)
email = left(Trim(Replace(Request.Form("email"),"'","''")),40)
ataNum = left(Trim(Replace(Request.Form("ataNum"),"'","''")),40)
ataAvg = left(Trim(Replace(Request.Form("ataAvg"),"'","''")),40)
ataYard = left(Trim(Replace(Request.Form("ataYard"),"'","''")),40)
if team_name <> "" THEN
'check to see if e-mail ADDY is already there
check_qry = "select * from teamtrap where ([team_name]) like ('" & _
team_name & "')"
DBConnectionTwunk()
check_connectstr = "Driver={SQL Server};SERVER=" & db_server & ";DATABASE=" & db_name & ";UID=" & db_username & ";PWD=" & db_userpassword
Set checkConn = Server.CreateObject("ADODB.Connection")
checkConn.Open check_connectstr
countrec=0
Set checkRS = checkConn.Execute(check_qry)
if not checkRS.EOF then
while not checkRS.EOF
countrec=countrec+1
checkRS.movenext
wend
checkRS.close
end if
Set checkRs = nothing
Set checkConn = nothing
if countrec > 0 then
'If Rec Found then Throw Dupe E-Mail Error Page
Response.Redirect "http://somesite.com/Team_RegistrationERROR.asp"
else
'Else Throw Error Pg if Prob
Response.Redirect "http://somesite.com/Team_CCpayment.asp"
end if
end if
Function DBConnectionTwunk()
'Routine makes SQLServer DB Conn
db_server = "somesite.net"
db_name = "DB_name"
db_username = "username"
db_userpassword = "12345"
fieldname = "fieldname"
tablename = "tablename"
End Function
%>
Bookmarks