<%@ language=vbscript%> <% AddDate = request("AddDate") name = request("name") surname = request("surname") title = request("title") med = request("med") add1 = request("add1") add2 = request("add2") add3 = request("add3") code = request("code") country = request("country") email = request("email") telcode = request("telcode") telnum = request("telnum") faxcode = request("faxcode") faxnum = request("faxnum") mobile = request("mobile") employer = request("employer") priv = request("priv") manage = request("manage") state = request("state") academic = request("academic") job = request("job") qual1 = request("qual1") qual2 = request("qual2") qual3 = request("qual3") qual4 = request("qual4") newsletter = request("newsletter") electronic = request("electronic") post = request("post") sUserName = request("txtUserName") sPassword1 = request("Password1") sPassword2 = request("Password2") sHint = request("Hint") activate = request("activate") security = lcase(request("security")) if priv = "" then priv = "0" if manage = "" then manage = "0" if state = "" then state = "0" if academic = "" then academic = "0" if newsletter = "" then newletter = "0" if electronic = "" then electronic = "0" if post = "" then post = "0" if activate = "" then activate = "0" theYear = DatePart("yyyy", Now()) theMonth = DatePart("m", Now()) theDay = DatePart("d", Now()) theMonth = Right("00" & CStr(theMonth),2) theDay = Right("00" & CStr(theDay),2) strDateAdded = theYear & "/" & theMonth & "/" & theDay Action = Request("action") If Action = "send" then If len(sUserName) < 5 Then sUErr = "Username is too short" Action = "" End If If len(sPassword1) < 5 then sP1Err = "Password is too short" Action = "" End If If sPassword1 <> sPassword2 Then sP2Err = "Password does not match" Action = "" End If If Len(email) < 5 Then errorEmail="Please enter an E-Mail Address..." Action = "" Else If Instr(email, " ") <> 0 Then errorEmail="Please enter a valid E-Mail Address..." Action = "" Else If InStr(email, "@") < 2 Then errorEmail="Please enter a valid E-Mail Address..." Action = "" Else If InStrRev(email, ".") < InStr(email, "@") + 2 Then errorEmail="Please enter a valid E-Mail Address..." Action = "" End If End If End If End If If name ="" Then errorName="Please enter your Name" Action = "" end if If surname ="" Then errorSurname="Please enter your Surname" Action = "" end if If title ="" Then errorTitle="Please enter your Title" Action = "" end if If security <> "spf5amz" Then errorSecurity="Please enter your Word Verification" Action = "" end if IF Action = "send" then set myRS = Server.CreateObject ("ADODB.Recordset") SQL = "INSERT INTO Member(mem_DateAdded, mem_name, mem_surname, mem_title, mem_med, mem_add1, mem_add2, mem_add3, mem_code, mem_country, mem_email, mem_telcode, mem_telnum, mem_faxcode, mem_faxnum, mem_employer, mem_private, mem_manage, mem_state, mem_academic, mem_job, mem_qual1, mem_qual2, mem_qual3, mem_qual4, mem_newsletter, mem_electronic, mem_post, mem_activate, mem_mobile, mem_username, mem_password, mem_Hint, mem_active ) VALUES ('" & strDateAdded & "','" & name & "', '" & surname & "', '" & title & "', '" & med & "', '" & add1 & "', '" & add2 & "', '" & add3 & "', '" & code & "', '" & country & "', '" & email & "', '" & telcode & "', '" & telnum & "', '" & faxcode & "', '" & faxnum & "', '" & employer & "', '" & priv & "', '" & manage & "', '" & state & "', '" & academic & "', '" & job & "', '" & qual1 & "', '" & qual2 & "', '" & qual3 & "', '" & qual4 & "', '" & newsletter & "', '" & electronic & "', '" & post & "', '" & activate & "', '" & mobile & "', '" & sUserName & "', '" & sPassword1 & "', '" & sHint & "', '1')" myRS.Open SQL, oConn set myRS = nothing Session("email") = email thisbody = "Information recieved on " & now ()& "

" thisbody = thisbody & "Title : " & title & "
" thisbody = thisbody & "First Name : " & name & "
" thisbody = thisbody & "Surname : " & surname & ",
" thisbody = thisbody & "Email : " & email & ",
" thisbody = thisbody & "Phone : (" & telcode & ")" & telnum & ",
" thisbody = thisbody & "Mobile : (" & mobile & ")" & telnum & ",
" thisbody = thisbody & "Username : " & sUserName & "
" thisbody = thisbody & "Password : " & sPassword1 & "
" thisbody = thisbody & "Password Hint: " & sHint & "
" Set myCDONTS = Server.CreateObject("CDONTS.NewMail") thisBody = "

" & thisBody & "

" thisBody = thisBody & "

This user has applied for membership and awaits approval.

" 'myCDONTS.MailFormat = 0 myCDONTS.BodyFormat = 0 myCDONTS.From = "" myCDONTS.To = "SA-HYpertension Administrator " myCDONTS.Subject = "Southern African Hypertension Society (New Member Application)" myCDONTS.Body = thisBody myCDONTS.Send Set myCDONTS = Nothing thisbody = "Hypertension Registration Information:

" thisBody = thisBody & "

" thisBody = thisBody & "Thank you for applying for registration. Your details are as follows:

" thisbody = thisbody & "Title : " & title & "
" thisbody = thisbody & "First Name : " & name & "
" thisbody = thisbody & "Surname : " & surname & ",
" thisbody = thisbody & "Email : " & email & ",
" thisbody = thisbody & "Phone : (" & telcode & ")" & telnum & ",
" thisbody = thisbody & "Mobile : (" & mobile & ")" & telnum & ",
" thisbody = thisbody & "Username : " & sUserName & "
" thisbody = thisbody & "Password : " & sPassword1 & "
" thisbody = thisbody & "Password Hint: " & sHint & "
" Set myCDONTS = Server.CreateObject("CDONTS.NewMail") thisBody = "

" & thisBody & "

" 'myCDONTS.MailFormat = 0 myCDONTS.BodyFormat = 0 myCDONTS.From = "" myCDONTS.To = name & " " & surname & "<" & email & ">" myCDONTS.Subject = "Southern African Hypertension Society (New Member Application)" myCDONTS.Body = thisBody myCDONTS.Send Set myCDONTS = Nothing set oRS = server.CreateObject ("ADODB.Recordset") sql = "select * from Member where mem_username = '" & sUserName & "' AND mem_password = '" & sPassword & "' AND mem_active = 1" response.write sql oRS.Open sql, oConn If NOT(oRS.BOF = True and oRS.EOF = True) then Session("UserID") = oRS("mem_username") Session("UID") = oRS("mem_id") Session("UserName") = oRS("mem_name") Session("LoggedIn") = "Yes" if session("goBackTo") = "" then Response.Redirect "news.asp" else Response.Redirect session("goBackTo") End If Else myErr = "Could not log you in, sorry" End If Response.Redirect "thanks.asp" End If End If %> Southern African Hypertension Society

<% If Action = "send" then %> Your Query Application has been submitted
Go back to the site


<% Else %>
  readonly>
Fields marked with * must be completed for registration
Title: *   > <% if errorTitle > "" then response.write "
" & errorTitle end if%>
Name: *   > <% if errorName > "" then response.write "
" & errorName end if%>
Surname: *   > <% if errorSurname > "" then response.write "
" & errorSurname end if%>
E-Mail Address: *   > <% if errorEmail > "" then response.write "
" & errorEmail end if%>
 
Username: *   <% if sUErr > "" then response.write "
" & sUErr end if%>
Password: *   <% if sP1Err > "" then response.write "
" & sP1Err end if%>
Confirm Password: *   <% if sP2Err > "" then response.write "
" & sP2Err end if%>
Password Hint:  
 
Postal Address:   >
  >
  >
Postal Code:   >
Country:   >
 
Tel:  
Fax:  
Cell Phone:  
 
Employer Name:   >
Position:   >
HPCSA or other professional
number e.g.MP number:
  >
Private:   checked <%end if%>">
Manager:   checked <%end if%>">
State:   checked <%end if%>">
Academic:   checked <%end if%>">
 
Qualification #1:   >
Qualification #2:   >
Qualification #3:   >
Qualification #4:   >
 
Receive News Letter:   checked <%end if%>">
Receive E-Mail:   checked <%end if%>">
Receive Post:   checked <%end if%>">
Word Verification:
Type the characters you see in the picture below. Letters are not case-sensitive
  <% if errorSecurity > "" then response.write "
" & errorSecurity end if%>
 
 
I have read and agree with the TERMS AND CONDITIONS OF USE provided
<%end if%>