<%@LANGUAGE="VBSCRIPT"%> <% ' *** 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 = "" %> <% set Recordset2 = Server.CreateObject("ADODB.Recordset") Recordset2.ActiveConnection = MM_connection_STRING Recordset2.Source = "SELECT * FROM kurzus ORDER BY Azonosító ASC" Recordset2.CursorType = 0 Recordset2.CursorLocation = 2 Recordset2.LockType = 3 Recordset2.Open() Recordset2_numRows = 0 %> <% Email=Request.Form("Email") vnev=Request.Form("vnev") knev=Request.Form("knev") nev=Request.Form("felh") helyseg=Request.Form("helyseg") Session("MM_Username")=nev 'The function for sending the email using ASPEmail Function SendMail (FromName,FromEmail,MailContent,MailingAddress,Subject) Set Mail = Server.CreateObject("Persits.MailSender") Mail.Host = "geo.cslm.hu" ' Specify a valid SMTP server Mail.From = FromEmail ' Specify sender's address Mail.FromName = FromName ' Specify sender's name Mail.AddBcc MailingAddress Mail.Subject = "New user : " & vnev &" "& knev Mail.Body = MailContent mail.Send Set Mail=Nothing End Function %> <% ' *** Redirect if username exists MM_flag="MM_insert" If (CStr(Request(MM_flag)) <> "") Then MM_dupKeyRedirect="marvan.asp" MM_rsKeyConnection=MM_connection_STRING MM_dupKeyUsernameValue = CStr(Request.Form("felh")) MM_dupKeySQL="SELECT felhnev FROM fizetok WHERE felhnev='" & 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_connection_STRING MM_editTable = "fizetok" MM_editRedirectUrl = "register.asp" MM_fieldsStr = "vnev|value|knev|value|felh|value|helyseg|value|email|value|kurz|value|csoport|value" MM_columnsStr = "Vezeteknev|',none,''|Keresztnev|',none,''|felhnev|',none,''|cim|',none,''|email|',none,''|kurzus|',none,''|leiras|',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 %> <% '**** ures karatker uresVnev = CStr(Request.Form("vnev")) %> <% ' *** Insert Record: construct a sql insert statement and execute it 'if (Request(felh)="") then 'Response.Redirect("ures.asp") 'else If (((((CStr(Request("MM_insert")) <> "") and CStr(Request.Form("vnev")) <> "") and _ CStr(Request.Form("knev")) <> "") and CStr(Request.Form("felh")) <> "") and _ (email <> "" )) and (len(CStr(Request.Form("felh")))> 4) 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 & ")" SendMail "Uniphorm Adminisztrator","jk@cslm.hu","New user: " & vnev &" "& knev &" " & "Date: " & Date & "Email : " & email,"jk@geo.cslm.hu","Your login information is enclosed!" SendMail "Uniphorm Adminisztrator","jk@cslm.hu","Welcome ! " & "Login name : " & nev ,email,"Your login information is enclosed!" 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 End If %> <% set Recordset1 = Server.CreateObject("ADODB.Recordset") Recordset1.ActiveConnection = MM_connection_STRING Recordset1.Source = "SELECT * FROM fizetok" Recordset1.CursorType = 0 Recordset1.CursorLocation = 2 Recordset1.LockType = 3 Recordset1.Open() Recordset1_numRows = 0 %> Registered Protected

 

    * Required fields
     
First name :*
  Last name :*
  Login name :* (min. 4 - max. 10 characters)
  Adress:
  Email:*
(You will recieve your password to this e-mail address)
  Course name:* (!)
 
 
     
   

Back

<% Recordset1.Close() %> <% Recordset2.Close() %>