%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<%
'Code to prevent the page from being cached
Response.CacheControl = "no-cache"
Response.AddHeader "Pragma", "no-cache"
Response.Expires = -1
'Some site constants
site_url = "http://" & Request.ServerVariables("SERVER_NAME") & "/"
site_name = "isapindia.org"
admin_name = "Admin"
admin_email = "admin@isapindia.org"
sendEmail = True
'Check if the form has been submitted
If Request.Form("Submit") = "Register" Then
'Simple string validation function. This can be expanded on.
Function validateStr(str)
temp = str
temp = Trim(temp)
temp = Replace(temp,"'","''")
validateStr = temp
End Function
'Simple email validation function. e.g. abc123@domain.ext
Function validateEmail(email)
isValidE = True
set regEx = New RegExp
regEx.IgnoreCase = False
regEx.Pattern = "^[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$"
isValidE = regEx.Test(email)
validateEmail = isValidE
End Function
'Grab the form data
eventname = validateStr(Request.Form("event_name"))
emailid = validateStr(Request.Form("email"))
name1 = validateStr(Request.Form("name"))
company1 = validateStr(Request.Form("company"))
street_address1 = validateStr(Request.Form("street_address"))
city_state1 = validateStr(Request.Form("city_state"))
zip_pin1 = validateStr(Request.Form("zip_pin"))
mobilnumber1 = validateStr(Request.Form("mobilenumber"))
member_country1 = validateStr(Request.Form("member_country"))
countrycode1 = validateStr(Request.Form("countrycode"))
areacode1 = validateStr(Request.Form("areacode"))
phone1 = validateStr(Request.Form("phone"))
faxcountrycode1 = validateStr(Request.Form("faxcountrycode"))
faxareacode1 = validateStr(Request.Form("faxareacode"))
fax1 = validateStr(Request.Form("fax"))
'Data validation
If emailid = "" Then
errMsg = errMsg & "-Please enter a emailid
"
If name1 = "" Then
errMsg = errMsg & "-Please enter a name
"
If member_country1= "" Then
errMsg = "-Please enter a country
"
End If
If countrycode1= "" Then
errMsg = "-Please enter a countrycode
"
End If
If areacode1= "" Then
errMsg = "-Please enter a areacode
"
End If
If phone1= "" Then
errMsg = "-Please enter a phone
"
End If
'If there are no errors then continue with the registration
If Len(errMsg) = 0 Then
Set conn=Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open Server.MapPath("login.mdb")
Set rsCheckUser = Server.CreateObject("ADODB.recordset")
'Insert the data into the database
sql = "INSERT INTO users (eventname,emailid,name1,company1,street_address1,city_state1,zip_pin1,mobilnumber1,member_country1,countrycode1,areacode1,phone1,faxcountrycode1,faxareacode1,fax1) VALUES " &_
"('" & eventname & "'," &_
"'" & emailid & "'," &_
"'" & name1 & "'," &_
"'" & company1 & "'," &_
"'" & street_address1 & "'," &_
"'" & city_state1 & "'," &_
"'" & zip_pin1 & "'," &_
"'" & mobilnumber1 & "'," &_
"'" & member_country1& "'," &_
"'" & countrycode1 & "'," &_
"'" & phone1 & "'," &_
"'" & faxcountrycode1 & "'," &_
"'" & "'" & faxareacode1 & "'," &_
"'" & fax1 & "')"
conn.Execute sql
registered = True
msg = "Thankyou for registering at " & site_name
'If sendEmail is true then send the user an email
If sendEmail = True Then
'Set the body text message for the email
body = "Name: " & name1 & vbCRLF &_
"Email: " & emailid & vbCRLF &_
vbCRLF & vbCRLF & msg & vbCRLF & "You can login at " & site_url &
Set myMail=CreateObject("CDO.Message")
myMail.Subject= msg
myMail.From= """" & admin_name & """<" & admin_email & ">"
myMail.To= """" & name1 & """<" & emailid1 & ">"
myMail.TextBody=body
myMail.Send
emailSent = True
Set myMail=nothing
End If
'Clear form details
user_name = ""
user_pass = ""
user_email = ""
End If
rsCheckUser.Close
conn.Close
End If
End If
%>
National Medicinal Plant Board
|
INDIAN SOCIETY OF AGRIBUSINESS PROFESSIONALS PRESENTS |
|
Home | Introduction | Objective | Agenda |Article submission | Participation | Sponsor |Register | Contact |
||
![]() ![]() ![]() ![]() ![]() ![]()
|
||
|