<% Function mySubj() x= Request.Form("Email") response.write x 'x="hello" 'MsgBox(x) mySubj = "1" end Function Sub MyVbTest() MsgBox("Testing from VB Script!") End Sub Function sha256hashBytes(aBytes) Dim sha256 set sha256 = CreateObject("System.Security.Cryptography.SHA256Managed") sha256.Initialize() 'Note you MUST use computehash_2 to get the correct version of this method, and the bytes MUST be double wrapped in brackets to ensure they get passed in correctly. sha256hashBytes = sha256.ComputeHash_2( (aBytes) ) End Function Function stringToUTFBytes(aString) Dim UTF8 Set UTF8 = CreateObject("System.Text.UTF8Encoding") stringToUTFBytes = UTF8.GetBytes_4(aString) End Function Function copyfile() carlos = CopyFile_RandomName("http://www.Phinancetechnologies.somee.com/website riskmath/Files/Demographic Projections RiskMath Book Country Report - Japan.pdf", "") copyfile="http://www.Phinancetechnologies.somee.com/website riskmath/Files/Demographic Projections RiskMath Book Country Report - Japan.pdf" 'copyfile="Phinancetechnologies.somee.com/website riskmath/Files/Demographic Projections RiskMath Book Country Report - Japan.pdf" 'copyfile="content/Japan report.pdf" End Function Sub createfolder(FolderPath) 'verify if folder exists Dim filesys, newfolder, newfolderpath 'newfolderpath = "C:\Web\Website Riskmath\temp2" newfolderpath = FolderPath set filesys=CreateObject("Scripting.FileSystemObject") If Not filesys.FolderExists(newfolderpath) Then Set newfolder = filesys.CreateFolder(newfolderpath) End If End Sub 'This function Copies a Source File to the Target Folder with a random name. 'It then appends the same extension of the original file. 'It returns the target File name for use elsewhere Function CopyFile_RandomName(SourceFile, TargetFolder) 'Copy all files from fldr to destination folder and append the date (in ISO 'format) to the name. Overwrite existing files. Dim fso, myfile Set fso = CreateObject("Scripting.FileSystemObject") source_f_name = fso.GetBaseName(sourceFile) source_f_folder = fso.GetParentFolderName(sourceFile) source_f_extension = fso.GetExtensionName(sourceFile) set myfile = fso.GetFile(SourceFile) targetFolder = TargetFolder target_f_name = source_f_name & "_" & RandomString(10) target_f_extension = source_f_extension target_file = target_f_name & "." & target_f_extension 'target_file = "aaaa.pdf" 'full_target_file = targetFolder & target_file myfile.Copy (targetFolder & "\" & target_file) CopyFile_RandomName = targetFolder & "\" & target_file End Function Function RandomString(strLength) Rndstr="" LETTERS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_+-" Randomize For i = 1 to strLength myval = Len(LETTERS)*Rnd Rndstr = Rndstr & Mid( LETTERS, Int(myval+1), 1 ) Next RandomString = Rndstr End Function 'This function Copies a Source File to the Target File. Function CopyFile_Phitech(SourceFile, TargetFile) Dim fso, myfile Set fso = CreateObject("Scripting.FileSystemObject") set myfile = fso.GetFile(SourceFile) myfile.Copy (TargetFile) CopyFile_Phitech = TargetFile End Function Function myDateFormat(myDate) d = TwoDigits(Day(myDate)) m = TwoDigits(Month(myDate)) y = TwoDigits(Year(myDate)) h = TwoDigits(Hour(myDate)) mm = TwoDigits(Minute(myDate)) ss = TwoDigits(Second(mydate)) myDateFormat= y & "-" & m & "-" & d & " " & h & ":" & mm & ":" & ss End Function Function TwoDigits(num) If(Len(num)=1) Then TwoDigits="0"&num Else TwoDigits=num End If End Function Sub createFolder(infolder) Dim oFSO Set oFSO = CreateObject("Scripting.FileSystemObject") doesfolderexist = oFSO.FolderExists("C:\Web\Website Riskmath\" & infolder) If Not doesfolderexist Then oFSO.CreateFolder "C:\Web\Website Riskmath\" & infolder 'Create a new folder End If End sub Function Return_ULI(userx, paxx) Dim DB Set DB=Server.CreateObject("ADODB.Connection") DB.Open("DRIVER={SQL Server};SERVER=PhinancetechnologiesDB.mssql.somee.com;Initial Catalog=PhinancetechnologiesDB;user id=carlosalegria_SQLLogin_1;Password=pvc1zc3k3u") sql="select * from login_users where user_login='"& user & "' and user_pass='"& pax&"'" 'response.write "
" & sql Dim qa set qa = Server.CreateObject("ADODB.Recordset") qa.open sql, DB Dim ULI ULI=False Dim pview pview ="" if qa.eof then response.write "USER NOT RECOGNIZED" loginFailed= True else response.write "

WELCOME " & user & "!

" pview=trim(qa.fields.item("user_passview")) ULI = True end if Dim OutputArray(2) 'Output array to output (ULi, passview) (boolean, string) OutputArray(1) = ULI OutputArray(2) = pview Return_ULI = OutputArray End Function Function Return_ULI_V3(userx, paxx) Dim usery Dim paxy usery = userx paxy = paxx response.write "

UserY before: " & usery & "!

" '[^a-zA-Z_0-9] == \W With (New RegExp) .Global = True .Pattern = "\W" 'matches all non-digits usery = .Replace(usery, "") 'all non-digits removed paxy = .Replace(paxy, "") 'all non-digits removed End With response.write "

UserY after: " & usery & "!

" Dim DB Set DB=Server.CreateObject("ADODB.Connection") 'DB.Open("DRIVER={SQL Server};SERVER=PhinancetechnologiesDB.mssql.somee.com;Initial Catalog=PhinancetechnologiesDB;user id=carlosalegria_SQLLogin_1;Password=pvc1zc3k3u") DB.Open("Driver={MySQL ODBC 3.51 Driver};Server=n1nlmysql43plsk.secureserver.net;Database=humanityprojects;User=calegria;Password=Carlos_Root_123") sql="select * from login_users where user_login='"& usery & "' and user_pass='"& paxy&"'" 'response.write "
" & sql Dim qa set qa = Server.CreateObject("ADODB.Recordset") qa.open sql, DB Dim ULI ULI=False Dim pview pview ="" if qa.eof then response.write "USER NOT RECOGNIZED" loginFailed= True else response.write "

WELCOME " & user & "!

" pview=trim(qa.fields.item("user_passview")) ULI = True end if Dim OutputArray(2) 'Output array to output (ULi, passview) (boolean, string) OutputArray(1) = ULI OutputArray(2) = pview Return_ULI_V3 = OutputArray End Function Function CheckPassView(passv) Dim uli uli = false if passv="" then else Dim DB Set DB=Server.CreateObject("ADODB.Connection") Dim Cmd1 Set Cmd1=Server.createobject("ADODB.Command") DB.Open("DRIVER={SQL Server};SERVER=PhinancetechnologiesDB.mssql.somee.com;Initial Catalog=PhinancetechnologiesDB;user id=carlosalegria_SQLLogin_1;Password=pvc1zc3k3u") Cmd1.ActiveConnection = DB sql="select * from login_users where user_passview='" & passv & "'" Cmd1.CommandText = sql Dim RS1 set RS1 = Server.CreateObject("ADODB.Recordset") RS1.open Cmd1 if RS1.eof then uli = False else uli = True end if RS1.Close 'Set RS1 = nothing 'Set Cmd1 = nothing DB.Close 'DB.ConnectionString = "" end if CheckPassView = uli End Function Function CheckPassView_V3(passv) Dim uli uli = false if passv="" then else Dim DB Set DB=Server.CreateObject("ADODB.Connection") Dim Cmd1 Set Cmd1=Server.createobject("ADODB.Command") 'DB.Open("DRIVER={SQL Server};SERVER=PhinancetechnologiesDB.mssql.somee.com;Initial Catalog=PhinancetechnologiesDB;user id=carlosalegria_SQLLogin_1;Password=pvc1zc3k3u") DB.Open("Driver={MySQL ODBC 3.51 Driver};Server=n1nlmysql43plsk.secureserver.net;Database=humanityprojects;User=calegria;Password=Carlos_Root_123") Cmd1.ActiveConnection = DB sql="select * from login_users where user_passview='" & passv & "'" Cmd1.CommandText = sql Dim RS1 set RS1 = Server.CreateObject("ADODB.Recordset") RS1.open Cmd1 if RS1.eof then uli = False else uli = True end if RS1.Close 'Set RS1 = nothing 'Set Cmd1 = nothing DB.Close 'DB.ConnectionString = "" end if CheckPassView_V3 = uli End Function Function CheckPassView_SubsNum(passv, subs_num) Dim uli uli = false if passv="" then else Dim DB Set DB=Server.CreateObject("ADODB.Connection") Dim Cmd1 Set Cmd1=Server.createobject("ADODB.Command") DB.Open("DRIVER={SQL Server};SERVER=PhinancetechnologiesDB.mssql.somee.com;Initial Catalog=PhinancetechnologiesDB;user id=carlosalegria_SQLLogin_1;Password=pvc1zc3k3u") Cmd1.ActiveConnection = DB sql="select * from login_users where user_passview='" & passv & "'" & "and ((active_subscription_num='" & Cstr(subs_num) & "') or (active_subscription_num='" & Cstr(0) & "') or (active_subscription_num='" & Cstr(3) & "'))" Cmd1.CommandText = sql Dim RS1 set RS1 = Server.CreateObject("ADODB.Recordset") RS1.open Cmd1 if RS1.eof then uli = False else uli = True end if 'response.write "


Run until here 1" & uli & "!

" RS1.Close 'Set RS1 = nothing 'Set Cmd1 = nothing DB.Close 'DB.ConnectionString = "" end if 'response.write "


Run until here 2" & uli & "!

" CheckPassView_SubsNum = uli End Function Function CheckPassView_SubsNum_V3(passv, subs_num) Dim uli uli = false if passv="" then else Dim DB Set DB=Server.CreateObject("ADODB.Connection") Dim Cmd1 Set Cmd1=Server.createobject("ADODB.Command") 'DB.Open("DRIVER={SQL Server};SERVER=PhinancetechnologiesDB.mssql.somee.com;Initial Catalog=PhinancetechnologiesDB;user id=carlosalegria_SQLLogin_1;Password=pvc1zc3k3u") DB.Open("Driver={MySQL ODBC 3.51 Driver};Server=n1nlmysql43plsk.secureserver.net;Database=humanityprojects;User=calegria;Password=Carlos_Root_123") Cmd1.ActiveConnection = DB sql="select * from login_users where user_passview='" & passv & "'" & "and ((active_subscription_num='" & Cstr(subs_num) & "') or (active_subscription_num='" & Cstr(0) & "') or (active_subscription_num='" & Cstr(3) & "'))" Cmd1.CommandText = sql Dim RS1 set RS1 = Server.CreateObject("ADODB.Recordset") RS1.open Cmd1 if RS1.eof then uli = False else uli = True end if 'response.write "


Run until here 1" & uli & "!

" RS1.Close 'Set RS1 = nothing 'Set Cmd1 = nothing DB.Close 'DB.ConnectionString = "" end if 'response.write "


Run until here 2" & uli & "!

" CheckPassView_SubsNum_V3 = uli End Function Function InsertActivity(passv, activity) Dim DB Set DB=Server.CreateObject("ADODB.Connection") Dim Cmd1 Set Cmd1=Server.createobject("ADODB.Command") DB.Open("DRIVER={SQL Server};SERVER=PhinancetechnologiesDB.mssql.somee.com;Initial Catalog=PhinancetechnologiesDB;user id=carlosalegria_SQLLogin_1;Password=pvc1zc3k3u") Cmd1.ActiveConnection = DB 'response.write "


Error here 1" & "!

" sql="select * from login_users where user_passview='" & passv & "'" Cmd1.CommandText = sql Dim RS1 set RS1 = Server.CreateObject("ADODB.Recordset") RS1.open Cmd1 Dim userid, userpv, clientacc, timestamp, ActivityDetail_RemoteAddr, ActivityDetail_RemoteHost, ActivityDetail_HTTPUserAgent, ActivityDetail_HTTPReferer, ActivityDetail_LocalAddr, ActivityDetail_Action 'response.write "


Error here 2" & "!

" if RS1.eof then uli = False 'user not logged in. Monitor activity as guest userid = "0" userpv = "0" clientacc = "0" timestamp = myDateFormat(Now()) 'uses external file ActivityDetail_RemoteAddr = request.servervariables ("REMOTE_ADDR") ActivityDetail_RemoteHost = request.servervariables ("REMOTE_HOST") ActivityDetail_HTTPUserAgent = request.servervariables ("HTTP_USER_AGENT") ActivityDetail_HTTPReferer = request.servervariables ("HTTP_REFERER") ActivityDetail_LocalAddr = request.servervariables ("LOCAL_ADDR") ActivityDetail_Action = activity else 'user = RS1.fields.item("user_login") userid = RS1.fields.item("user_id") userpv = RS1.fields.item("user_passview") clientacc = RS1.fields.item("client_Accountnum") timestamp = myDateFormat(Now()) 'uses external file ActivityDetail_RemoteAddr = request.servervariables ("REMOTE_ADDR") ActivityDetail_RemoteHost = request.servervariables ("REMOTE_HOST") ActivityDetail_HTTPUserAgent = request.servervariables ("HTTP_USER_AGENT") ActivityDetail_HTTPReferer = request.servervariables ("HTTP_REFERER") ActivityDetail_LocalAddr = request.servervariables ("LOCAL_ADDR") ActivityDetail_Action = activity 'HTTP_REFERER Returns a string containing the URL of the page that referred the request to the current page using an tag. If the page is redirected, HTTP_REFERER is empty 'HTTP_USER_AGENT Returns a string describing the browser that sent the request 'LOCAL_ADDR Returns the server address on which the request came in 'REMOTE_ADDR Returns the IP address of the remote host making the request 'REMOTE_HOST Returns the name of the host making the request end if 'Insert data into DB Dim Cmd2 Set Cmd2=Server.createobject("ADODB.Command") Cmd2.ActiveConnection = DB sqlinsert="insert into dbo.login_activity (user_id,user_passview, client_Accountnum, activity_timestamp, activitydetail_remoteaddr, activitydetail_remotehost, activitydetail_httpuseragent, activitydetail_httpreferer, activitydetail_localaddr, activitydetail_action) VALUES (" & _ "'" & userid & "','" & userpv & "','" & clientacc & "','" & timestamp & "','" & ActivityDetail_RemoteAddr & "','" & ActivityDetail_RemoteHost & "','" & ActivityDetail_HTTPUserAgent & "','" & ActivityDetail_HTTPReferer & "','" & ActivityDetail_LocalAddr & "','" & ActivityDetail_Action & "')" 'response.write "


Activity SQL String: " & sqlinsert & "!

" Dim RS2 Set RS2 = Server.CreateObject("ADODB.Recordset") Cmd2.commandtext = sqlinsert Set RS2 = Cmd2.Execute '*********************************** End Data actvity data insert RS1.Close 'RS2.Close 'response.write "


Activity SQL String inserted! " & "!

" Set Cmd2 = nothing DB.Close 'Set RS2=Nothing 'Set RS1=Nothing 'DB.ConnectionString = "" InsertActivity="0" End Function Function InsertActivity_V3(passv, activity) Dim DB Set DB=Server.CreateObject("ADODB.Connection") Dim Cmd1 Set Cmd1=Server.createobject("ADODB.Command") 'DB.Open("DRIVER={SQL Server};SERVER=PhinancetechnologiesDB.mssql.somee.com;Initial Catalog=PhinancetechnologiesDB;user id=carlosalegria_SQLLogin_1;Password=pvc1zc3k3u") DB.Open("Driver={MySQL ODBC 3.51 Driver};Server=n1nlmysql43plsk.secureserver.net;Database=humanityprojects;User=calegria;Password=Carlos_Root_123") Cmd1.ActiveConnection = DB 'response.write "


Error here 1" & "!

" sql="select * from login_users where user_passview='" & passv & "'" Cmd1.CommandText = sql Dim RS1 set RS1 = Server.CreateObject("ADODB.Recordset") RS1.open Cmd1 Dim userid, userpv, clientacc, timestamp, ActivityDetail_RemoteAddr, ActivityDetail_RemoteHost, ActivityDetail_HTTPUserAgent, ActivityDetail_HTTPReferer, ActivityDetail_LocalAddr, ActivityDetail_Action 'response.write "


Error here 2" & "!

" if RS1.eof then uli = False 'user not logged in. Monitor activity as guest userid = "0" userpv = "0" clientacc = "0" timestamp = myDateFormat(Now()) 'uses external file ActivityDetail_RemoteAddr = request.servervariables ("REMOTE_ADDR") ActivityDetail_RemoteHost = request.servervariables ("REMOTE_HOST") ActivityDetail_HTTPUserAgent = request.servervariables ("HTTP_USER_AGENT") ActivityDetail_HTTPReferer = request.servervariables ("HTTP_REFERER") ActivityDetail_LocalAddr = request.servervariables ("LOCAL_ADDR") ActivityDetail_Action = activity else 'user = RS1.fields.item("user_login") userid = RS1.fields.item("user_id") userpv = RS1.fields.item("user_passview") clientacc = RS1.fields.item("client_Accountnum") timestamp = myDateFormat(Now()) 'uses external file ActivityDetail_RemoteAddr = request.servervariables ("REMOTE_ADDR") ActivityDetail_RemoteHost = request.servervariables ("REMOTE_HOST") ActivityDetail_HTTPUserAgent = request.servervariables ("HTTP_USER_AGENT") ActivityDetail_HTTPReferer = request.servervariables ("HTTP_REFERER") ActivityDetail_LocalAddr = request.servervariables ("LOCAL_ADDR") ActivityDetail_Action = activity 'HTTP_REFERER Returns a string containing the URL of the page that referred the request to the current page using an
tag. If the page is redirected, HTTP_REFERER is empty 'HTTP_USER_AGENT Returns a string describing the browser that sent the request 'LOCAL_ADDR Returns the server address on which the request came in 'REMOTE_ADDR Returns the IP address of the remote host making the request 'REMOTE_HOST Returns the name of the host making the request end if 'Insert data into DB Dim Cmd2 Set Cmd2=Server.createobject("ADODB.Command") Cmd2.ActiveConnection = DB sqlinsert="insert into login_activity (user_id,user_passview, client_accountnum, activity_timestamp, activitydetail_remoteaddr, activitydetail_remotehost, activitydetail_httpuseragent, activitydetail_httpreferer, activitydetail_localaddr, activitydetail_action) VALUES (" & _ "'" & userid & "','" & userpv & "','" & clientacc & "','" & timestamp & "','" & ActivityDetail_RemoteAddr & "','" & ActivityDetail_RemoteHost & "','" & ActivityDetail_HTTPUserAgent & "','" & ActivityDetail_HTTPReferer & "','" & ActivityDetail_LocalAddr & "','" & ActivityDetail_Action & "')" 'response.write "


Activity SQL String: " & sqlinsert & "!

" Dim RS2 Set RS2 = Server.CreateObject("ADODB.Recordset") Cmd2.commandtext = sqlinsert Set RS2 = Cmd2.Execute '*********************************** End Data actvity data insert RS1.Close 'RS2.Close 'response.write "


Activity SQL String inserted! " & "!

" Set Cmd2 = nothing DB.Close 'Set RS2=Nothing 'Set RS1=Nothing 'DB.ConnectionString = "" InsertActivity_V3="0" End Function Function InsertDB_HumanityProject(vName, vEmail, vUser_Pref) Dim DB Set DB=Server.CreateObject("ADODB.Connection") DB.Open("DRIVER={SQL Server};SERVER=PhinancetechnologiesDB.mssql.somee.com;Initial Catalog=PhinancetechnologiesDB;user id=carlosalegria_SQLLogin_1;Password=pvc1zc3k3u") Cmd1.ActiveConnection = DB Dim RS2 Dim Cmd2 Set Cmd2=Server.createobject("ADODB.Command") Cmd2.ActiveConnection = DB userid = RS1.fields.item("user_id") userpv = RS1.fields.item("user_passview") clientacc = RS1.fields.item("client_Accountnum") timestamp = myDateFormat(Now) 'uses external file ActivityDetails = activity & ", IP:" & request.servervariables ("REMOTE_ADDR") sqlinsert="insert into dbo.freesubscribers (Subscribe_timestamp,user_name, user_email, user_preference) VALUES (" & _ "'" & userid & "','" & userpv & "','" & clientacc & "','" & timestamp & "','" & ActivityDetails & "')" Set RS2 = Server.CreateObject("ADODB.Recordset") Cmd2.commandtext = sqlinsert Set RS2 = Cmd2.Execute RS2.Close 'Set Cmd2 = nothing 'response.write "passview " & RS1.fields.item("user_passview") & "" DB.Close Set RS2=Nothing 'DB.ConnectionString = "" InsertDB_HumanityProject = "ok" End Function Function InsertDB_HumanityProject_V3(vName, vEmail, vUser_Pref) Dim DB Set DB=Server.CreateObject("ADODB.Connection") 'DB.Open("DRIVER={SQL Server};SERVER=PhinancetechnologiesDB.mssql.somee.com;Initial Catalog=PhinancetechnologiesDB;user id=carlosalegria_SQLLogin_1;Password=pvc1zc3k3u") DB.Open("Driver={MySQL ODBC 3.51 Driver};Server=n1nlmysql43plsk.secureserver.net;Database=humanityprojects;User=calegria;Password=Carlos_Root_123") Cmd1.ActiveConnection = DB Dim RS2 Dim Cmd2 Set Cmd2=Server.createobject("ADODB.Command") Cmd2.ActiveConnection = DB userid = RS1.fields.item("user_id") userpv = RS1.fields.item("user_passview") clientacc = RS1.fields.item("client_Accountnum") timestamp = myDateFormat(Now) 'uses external file ActivityDetails = activity & ", IP:" & request.servervariables ("REMOTE_ADDR") sqlinsert="insert into humanityprojects.freesubscribers (Subscribe_timestamp,user_name, user_email, user_preference) VALUES (" & _ "'" & userid & "','" & userpv & "','" & clientacc & "','" & timestamp & "','" & ActivityDetails & "')" Set RS2 = Server.CreateObject("ADODB.Recordset") Cmd2.commandtext = sqlinsert Set RS2 = Cmd2.Execute RS2.Close 'Set Cmd2 = nothing 'response.write "passview " & RS1.fields.item("user_passview") & "" DB.Close Set RS2=Nothing 'DB.ConnectionString = "" InsertDB_HumanityProject_V3 = "ok" End Function Sub InsertDB_FreeSubscription(vName, vEmail, vUser_Pref) if passv="" then else Dim DB Set DB=Server.CreateObject("ADODB.Connection") Dim Cmd1 Set Cmd1=Server.createobject("ADODB.Command") DB.Open("DRIVER={SQL Server};SERVER=PhinancetechnologiesDB.mssql.somee.com;Initial Catalog=PhinancetechnologiesDB;user id=carlosalegria_SQLLogin_1;Password=pvc1zc3k3u") Cmd1.ActiveConnection = DB sql="select * from login_users where user_email='" & vEmail & "'" Cmd1.CommandText = sql Dim RS1, RS2 set RS1 = Server.CreateObject("ADODB.Recordset") RS1.open Cmd1 if RS1.eof then 'Email not found. Insert User uli = False else 'user = RS1.fields.item("user_login") Dim Cmd2 Set Cmd2=Server.createobject("ADODB.Command") Cmd2.ActiveConnection = DB userid = RS1.fields.item("user_id") userpv = RS1.fields.item("user_passview") clientacc = RS1.fields.item("client_Accountnum") timestamp = myDateFormat(Now) 'uses external file ActivityDetails = activity & ", IP:" & request.servervariables ("REMOTE_ADDR") sqlinsert="insert into dbo.freesubscribers (Subscribe_timestamp,user_name, user_email, user_preference) VALUES (" & _ "'" & userid & "','" & userpv & "','" & clientacc & "','" & timestamp & "','" & ActivityDetails & "')" Set RS2 = Server.CreateObject("ADODB.Recordset") Cmd2.commandtext = sqlinsert Set RS2 = Cmd2.Execute 'RS2.Close 'Set Cmd2 = nothing 'response.write "passview " & RS1.fields.item("user_passview") & "" end if RS1.Close 'Set RS1 = nothing 'Set Cmd1 = nothing DB.Close Set RS2=Nothing 'DB.ConnectionString = "" end if End Sub Sub InsertDB_FreeSubscription_V3(vName, vEmail, vUser_Pref) if passv="" then else Dim DB Set DB=Server.CreateObject("ADODB.Connection") Dim Cmd1 Set Cmd1=Server.createobject("ADODB.Command") 'DB.Open("DRIVER={SQL Server};SERVER=PhinancetechnologiesDB.mssql.somee.com;Initial Catalog=PhinancetechnologiesDB;user id=carlosalegria_SQLLogin_1;Password=pvc1zc3k3u") DB.Open("Driver={MySQL ODBC 3.51 Driver};Server=n1nlmysql43plsk.secureserver.net;Database=humanityprojects;User=calegria;Password=Carlos_Root_123") Cmd1.ActiveConnection = DB sql="select * from humanityprojects.login_users where user_email='" & vEmail & "'" Cmd1.CommandText = sql Dim RS1, RS2 set RS1 = Server.CreateObject("ADODB.Recordset") RS1.open Cmd1 if RS1.eof then 'Email not found. Insert User uli = False else 'user = RS1.fields.item("user_login") Dim Cmd2 Set Cmd2=Server.createobject("ADODB.Command") Cmd2.ActiveConnection = DB userid = RS1.fields.item("user_id") userpv = RS1.fields.item("user_passview") clientacc = RS1.fields.item("client_Accountnum") timestamp = myDateFormat(Now) 'uses external file ActivityDetails = activity & ", IP:" & request.servervariables ("REMOTE_ADDR") sqlinsert="insert into humanityprojects.freesubscribers (subscribe_timestamp,user_name, user_email, user_preference) VALUES (" & _ "'" & userid & "','" & userpv & "','" & clientacc & "','" & timestamp & "','" & ActivityDetails & "')" Set RS2 = Server.CreateObject("ADODB.Recordset") Cmd2.commandtext = sqlinsert Set RS2 = Cmd2.Execute 'RS2.Close 'Set Cmd2 = nothing 'response.write "passview " & RS1.fields.item("user_passview") & "" end if RS1.Close 'Set RS1 = nothing 'Set Cmd1 = nothing DB.Close Set RS2=Nothing 'DB.ConnectionString = "" end if End Sub Function findArea(radius) Alert "Computing Radius" const pi=3.14 area = pi*radius*radius findArea = area End Function Function Validate() 'Dim TheForm 'Set TheForm = Document.forms("myContactForm") 'Alert TheForm.mySubject.Value 'Validate = "ok" response.write "Hello" End Function Function InsertDB_HumanityProject_Subscribe(TableName, Values_string, vEmail) Dim DB Set DB=Server.CreateObject("ADODB.Connection") Dim Cmd1 Set Cmd1=Server.createobject("ADODB.Command") DB.Open("DRIVER={SQL Server};SERVER=PhinancetechnologiesDB.mssql.somee.com;Initial Catalog=PhinancetechnologiesDB;user id=carlosalegria_SQLLogin_1;Password=pvc1zc3k3u") Cmd1.ActiveConnection = DB sql="select * from " & TableName & " where Email='" & vEmail & "'" Cmd1.CommandText = sql Dim RS1, RS2 set RS1 = Server.CreateObject("ADODB.Recordset") RS1.open Cmd1 'response.write("Arrived here") if RS1.eof then 'Email not found. Insert User Dim Cmd2 Set Cmd2=Server.createobject("ADODB.Command") Cmd2.ActiveConnection = DB sqlinsert="insert into " & TableName & " VALUES " & Values_string Set RS2 = Server.CreateObject("ADODB.Recordset") Cmd2.commandtext = sqlinsert Set RS2 = Cmd2.Execute 'RS2.Close Set RS2 = nothing Set Cmd2 = nothing response.write "Inserted User Values: " & Values_string InsertDB_HumanityProject_Subscribe = "New user inserted" else 'Email found. Skip user Insert response.write "Email already exists: " & vEmail InsertDB_HumanityProject_Subscribe = "Email already exists" end if 'RS1.Close Set RS1 = nothing Set Cmd1 = nothing DB.Close Set DB = nothing 'return InsertDB_HumanityProject_Subscribe End Function Function InsertDB_HumanityProject_Subscribe_V3(TableName, Values_string, vEmail) Dim DB Set DB=Server.CreateObject("ADODB.Connection") Dim Cmd1 Set Cmd1=Server.createobject("ADODB.Command") 'DB.Open("DRIVER={SQL Server};SERVER=PhinancetechnologiesDB.mssql.somee.com;Initial Catalog=PhinancetechnologiesDB;user id=carlosalegria_SQLLogin_1;Password=pvc1zc3k3u") DB.Open("Driver={MySQL ODBC 3.51 Driver};Server=n1nlmysql43plsk.secureserver.net;Database=humanityprojects;User=calegria;Password=Carlos_Root_123") Cmd1.ActiveConnection = DB sql="select * from " & TableName & " where email='" & vEmail & "'" Cmd1.CommandText = sql Dim RS1, RS2 set RS1 = Server.CreateObject("ADODB.Recordset") RS1.open Cmd1 'response.write("Arrived here") if RS1.eof then 'Email not found. Insert User Dim Cmd2 Set Cmd2=Server.createobject("ADODB.Command") Cmd2.ActiveConnection = DB sqlinsert="insert into " & TableName & " VALUES " & Values_string Set RS2 = Server.CreateObject("ADODB.Recordset") Cmd2.commandtext = sqlinsert Set RS2 = Cmd2.Execute 'RS2.Close Set RS2 = nothing Set Cmd2 = nothing response.write "Inserted User Values: " & Values_string InsertDB_HumanityProject_Subscribe_V3 = "New user inserted" else 'Email found. Skip user Insert response.write "Email already exists: " & vEmail InsertDB_HumanityProject_Subscribe_V3 = "Email already exists" end if 'RS1.Close Set RS1 = nothing Set Cmd1 = nothing DB.Close Set DB = nothing 'return InsertDB_HumanityProject_Subscribe End Function Function AlterDB_HumanityProject_UnSubscribe(TableName, vEmail) Dim DB Set DB=Server.CreateObject("ADODB.Connection") Dim Cmd1 Set Cmd1=Server.createobject("ADODB.Command") DB.Open("DRIVER={SQL Server};SERVER=PhinancetechnologiesDB.mssql.somee.com;Initial Catalog=PhinancetechnologiesDB;user id=carlosalegria_SQLLogin_1;Password=pvc1zc3k3u") Cmd1.ActiveConnection = DB sql="select * from " & TableName & " where Email='" & vEmail & "'" Cmd1.CommandText = sql Dim RS1, RS2 set RS1 = Server.CreateObject("ADODB.Recordset") RS1.open Cmd1 if RS1.eof then 'Email not found. Return message response.write "Email does not exist. Need to Subscribe first." & vEmail InsertDB_HumanityProject_UnSubscribe = "Email does not exist." else 'Email found. Alter user subscribe Dim Cmd2 Set Cmd2=Server.createobject("ADODB.Command") Cmd2.ActiveConnection = DB sqlinsert="update " & TableName & " set b_askUnsubscribe='true' where Email = '" & vEmail & "'" Set RS2 = Server.CreateObject("ADODB.Recordset") Cmd2.commandtext = sqlinsert 'response.write("Executing SQL: " & sqlinsert) Set RS2 = Cmd2.Execute 'response.write("Arrived here") 'RS2.Close Set Cmd2 = nothing Set RS2= nothing response.write "
User Unsuscribed to email updates." InsertDB_HumanityProject_UnSubscribe = "User Unsuscribed." end if RS1.Close Set RS1 = nothing Set Cmd1 = nothing DB.Close Set DB = nothing End Function Function AlterDB_HumanityProject_UnSubscribe_V3(TableName, vEmail) Dim DB Set DB=Server.CreateObject("ADODB.Connection") Dim Cmd1 Set Cmd1=Server.createobject("ADODB.Command") 'DB.Open("DRIVER={SQL Server};SERVER=PhinancetechnologiesDB.mssql.somee.com;Initial Catalog=PhinancetechnologiesDB;user id=carlosalegria_SQLLogin_1;Password=pvc1zc3k3u") DB.Open("Driver={MySQL ODBC 3.51 Driver};Server=n1nlmysql43plsk.secureserver.net;Database=humanityprojects;User=calegria;Password=Carlos_Root_123") Cmd1.ActiveConnection = DB sql="select * from " & TableName & " where email='" & vEmail & "'" Cmd1.CommandText = sql Dim RS1, RS2 set RS1 = Server.CreateObject("ADODB.Recordset") RS1.open Cmd1 if RS1.eof then 'Email not found. Return message response.write "Email does not exist. Need to Subscribe first." & vEmail InsertDB_HumanityProject_UnSubscribe_V3 = "Email does not exist." else 'Email found. Alter user subscribe Dim Cmd2 Set Cmd2=Server.createobject("ADODB.Command") Cmd2.ActiveConnection = DB sqlinsert="update " & TableName & " set b_ask_unsubscribe='1' where email = '" & vEmail & "'" Set RS2 = Server.CreateObject("ADODB.Recordset") Cmd2.commandtext = sqlinsert 'response.write("Executing SQL: " & sqlinsert) Set RS2 = Cmd2.Execute 'response.write("Arrived here") 'RS2.Close Set Cmd2 = nothing Set RS2= nothing response.write "
User Unsuscribed to email updates." InsertDB_HumanityProject_UnSubscribe_V3 = "User Unsuscribed." end if RS1.Close Set RS1 = nothing Set Cmd1 = nothing DB.Close Set DB = nothing End Function Function InsertDB_Values_Generic(TableName, Values_string) InsertDB_Values_Generic = "DB Insert successful" Dim DB Set DB=Server.CreateObject("ADODB.Connection") DB.Open("DRIVER={SQL Server};SERVER=PhinancetechnologiesDB.mssql.somee.com;Initial Catalog=PhinancetechnologiesDB;user id=carlosalegria_SQLLogin_1;Password=pvc1zc3k3u") 'response.write("Arrived here") Dim Cmd2 Set Cmd2=Server.createobject("ADODB.Command") Cmd2.ActiveConnection = DB sqlinsert="insert into " & TableName & " VALUES " & Values_string Dim RS2 Set RS2 = Server.CreateObject("ADODB.Recordset") Cmd2.commandtext = sqlinsert On Error Resume Next Set RS2 = Cmd2.Execute If Err.Number <>0 Then InsertDB_Values_Generic = Err.Description Err.Clear End If On Error Goto 0 'RS2.Close Set RS2 = nothing Set Cmd2 = nothing DB.Close Set DB = nothing end Function Function InsertDB_Values_Generic_V3(TableName, Values_string) InsertDB_Values_Generic_V3 = "DB Insert successful" Dim DB Set DB=Server.CreateObject("ADODB.Connection") 'DB.Open("DRIVER={SQL Server};SERVER=PhinancetechnologiesDB.mssql.somee.com;Initial Catalog=PhinancetechnologiesDB;user id=carlosalegria_SQLLogin_1;Password=pvc1zc3k3u") DB.Open("Driver={MySQL ODBC 3.51 Driver};Server=n1nlmysql43plsk.secureserver.net;Database=humanityprojects;User=calegria;Password=Carlos_Root_123") 'response.write("Arrived here") Dim Cmd2 Set Cmd2=Server.createobject("ADODB.Command") Cmd2.ActiveConnection = DB sqlinsert="insert into " & TableName & " VALUES " & Values_string Dim RS2 Set RS2 = Server.CreateObject("ADODB.Recordset") Cmd2.commandtext = sqlinsert On Error Resume Next Set RS2 = Cmd2.Execute If Err.Number <>0 Then InsertDB_Values_Generic_V3 = Err.Description Err.Clear End If On Error Goto 0 'RS2.Close Set RS2 = nothing Set Cmd2 = nothing DB.Close Set DB = nothing end Function Function InsertDB_HumanityProject_RequestInvoice(TableName, Values_string) response.write "
Reched here Func1 - step 1" myResponse = InsertDB_Values_Generic(TableName, Values_string) response.write "
Reched here Func1 - step 2" InsertDB_HumanityProject_RequestInvoice = myResponse End Function Function InsertDB_HumanityProject_RequestInvoice_V3(TableName, Values_string) response.write "
Reched here Func1 - step 1" myResponse = InsertDB_Values_Generic_V3(TableName, Values_string) response.write "
Reched here Func1 - step 2" InsertDB_HumanityProject_RequestInvoice_V3 = myResponse End Function %>
Phitech Logo   PHINANCE TECHNOLOGIES

HUMANITY PROJECTS
HUMANITY PROJECTS
HUMANITY PROJECTS