CGI script to emulate Excel vba routine

jgoulart

Board Regular
Joined
Feb 16, 2002
Messages
62
First I appologize if this post is too far off topic for this board. I am getting ready to distribute an excel vba application that I want to have unique or semi-unique passwords for each username that is defined by the users last name. I have written a routine in excel that does this. Here is the code:

Sub password_gen()
Dim tempstr As String
Dim strlen As Integer
Dim x As Integer
Dim var1 As String
Dim ivar1 As String
Dim var2 As String
Dim rCtr
Dim a

tempstr = "Testdata" 'input user last name and use as username

strlen = Len(tempstr)

For x = 1 To strlen

var1 = Mid(tempstr, x, 1)

ivar1 = Asc(var1)
ivar1 = (ivar1 * x) + x + 3
While ivar1 > 122
ivar1 = ivar1 - 100
Wend
If (ivar1 > 47 And ivar1 < 58) Or _
(ivar1 > 64 And ivar1 < 91) Or _
(ivar1 > 96 And ivar1 < 123) Then
var1 = Chr(ivar1)
Else
While ivar1 > 10
ivar1 = ivar1 - 10
Wend
End If

var2 = var2 & var1
Next x


End Sub


What my dilemna is that I want to be able to run this same routine on my website that will generate and email a username and password to someone that logs in and requests the program. I don't know much (VERRRRY LITTLE IF JUST A HARE OVER NOTHING) about cgi script or programming it. Does anyone know of something that would generate a unique password depending on username that can be run as a cgi script. I am not 100% fixed on my method of generating the password in excel. I just want the 2 methods to match so that I can distribute my excel application that will calc and check the password and the website code would generate it. Does anyone have advice on where I would look to learn about how to write some cgi scripts that would do something close to what I'm asking.

Thanks,

John
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.

Forum statistics

Threads
1,214,399
Messages
6,119,279
Members
448,884
Latest member
chuffman431a

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top