% Function RegExpTest(patrn, strng) Dim regEx, Match, Matches ' Create variable. Set regEx = New RegExp ' Create a regular expression. regEx.Pattern = patrn ' Set pattern. regEx.IgnoreCase = True ' Set case insensitivity. regEx.Global = True ' Set global applicability. Set Matches = regEx.Execute(strng) ' Execute search. For Each Match in Matches ' Iterate Matches collection. RetStr = Match.Value Next RegExpTest = RetStr End Function allok = false if (request.form("submit") = "Submit Form") then allok = true if (request.form("contact") = "") then contactError = true allok = false end if if (request.form("school") = "") then schoolError = true allok = false end if if (request.form("email") = "") then emailError = true allok = false elseif RegExpTest("[A-Za-z0-9.\-]*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$", request("email")) = "" then emailError = true allok = false end if end if if allok then ' bit to set which servers to use to send the email (required) sch = "http://schemas.microsoft.com/cdo/configuration/" Set cdoConfig = Server.CreateObject("CDO.Configuration") cdoConfig.Fields.Item(sch & "sendusing") = 2 cdoConfig.Fields.Item(sch & "smtpserver") = "smtphost.ntu.ac.uk" cdoConfig.fields.update ' Main email bit (required :) ) Set cdoMessage = Server.CreateObject("CDO.Message") Set cdoMessage.Configuration = cdoConfig cdoMessage.From = request.form("email") cdoMessage.To = "alison.davies2@ntu.ac.uk" cdoMessage.Subject = "QCA-RSS Centre 2nd Review comment from " & request.form("contact") & " at " & request.form("school") cdoMessage.TextBody = "QCA-RSS Centre 2nd Review comment"&vbcrlf&vbcrlf&"The following information has been submitted to the QCA-RSS Centre Review website:"&vbcrlf&vbcrlf&"Contact Person: " & request.form("contact") &vbcrlf&vbcrlf& "School: " & request.form("school") &vbcrlf&vbcrlf& "E-Mail address: " & request.form("email") &vbcrlf&vbcrlf& "Online guidance: " & request.form("comment_og") &vbcrlf&vbcrlf& "Teaching Materials: " & request.form("comment_tm") &vbcrlf&vbcrlf& "Effectiveness: " & request.form("comment_em") &vbcrlf&vbcrlf& "General comment: " & request.form("comment_gen") &vbcrlf&vbcrlf& "at " & time & " on " & date cdoMessage.Send set cdoMessage = Nothing Set cdoConfig = Nothing SQLquery = "INSERT INTO QCARSSCSEReview_comments_additional (""contact"", ""school"", ""email"", ""comment_og"", ""comment_tm"", ""comment_em"", ""comment_gen"") VALUES ('" & request.form("contact") & "','" & request.form("school") & "','" & request.form("email") & "','" & request.form("comment_og") & "','" & request.form("comment_tm") & "','" & request.form("comment_em") & "','" & request.form("comment_gen") & "');" set reviews = Server.CreateObject("ADODB.Recordset") reviews.ActiveConnection = "Provider=SQLOLEDB;Data Source=BRADBURY.lsz.ntu.ac.uk;UID=rweb;PWD=sevengreensticklebricks;DATABASE=rweb" reviews.Source = SQLquery reviews.CursorType = 1 reviews.CursorLocation = 2 reviews.LockType = 3 reviews.Open end if %>
|
||||
| Comments on resources
Thanks for your interest. The trial is now over but please feel free to use the resources on the site. <% if allok then %>Your comments have been submitted. Thank you. Please use the link to return to the Project resources <% else %> <% if contactError then %>Please enter your Contact Person. <% end if %> <% if schoolError then %> <% end if %> <% if emailError then if (request.form("email") = "") then %>Please enter your E-mail address. <% else %>Please enter a valid E-mail address. <% end if end if %>You must enter data for every field marked with a *. <% end if %> |
|
© Copyright
- Royal Statistical Society Centre for Statistical Education 2006 All
Rights Reserved
|