Jump to content

AutoIt + (My) Website?


SKhan
 Share

Recommended Posts

Hey,

I'm new to the AutoIt community, and I need some help with a script: (See at end of post)

I've created a setup wizard to 'install' user-friendly tools into a USB drive. Currently it's not very functional based on my goals, basically I've only created a functional layout. In the long run of my program, I want to require people to register in order to update their settings and information. Currently, I hardly have any experience with HTML, so I don't have a website obviously, YET.

What I need help with is:

  • How to send information from a GUI to my website.
  • How to receive the information on my website, and how to deal with it.

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
Global $L = 1
Local $isCorrect
Local $Name, $Number, $Address, $CityStateZip, $eMail, $USBDrive
Begin()

Func Begin()
    $Form1 = GUICreate("INSERTNAMEHERE - Installation Wizard", 537, 366, -1, -1)
;~  $Pic1 = GUICtrlCreatePic("\..\Installer.jpg", 0, 0, 164, 313, BitOR($SS_NOTIFY, $WS_GROUP, $WS_CLIPSIBLINGS))
;; Dont worry about the picture. :)
    $Edit1 = GUICtrlCreateEdit("", 164, 0, 372, 313, BitOR($ES_READONLY, $ES_WANTRETURN))
    GUICtrlSetData(-1, StringFormat("\r\n   Welcome to the INSERTNAMEHERE Set-Up Wizard!\r\n\r\n\r\n   Blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah \r\n    blah blah blah yada yada no one cares.\r\n\r\n   The USB selected to install the security tools upon will be registered under\r\n    your account name, but really you dont care. so yada yada blah blah blah. You may only install upon ONE USB,\r\n   but we all know your gonna break the rules and install it on all ur drives.\r\n\r\n   It is recommended that you close all programs, and remain idle during \r\n   installation.\r\n\r\n\r\n   Click Next to continue, or cancel to exit setup.\r\n\r\n\r\n\r\n\r\n\r\n\r\n   Version 3.4.1"))
    GUICtrlSetColor(-1, 0x000000)
    GUICtrlSetBkColor(-1, 0xFFFFFF)
    $Next1 = GUICtrlCreateButton("Next >", 376, 328, 73, 25, BitOR($BS_DEFPUSHBUTTON, $WS_GROUP))
    $Cancel1 = GUICtrlCreateButton("Cancel", 456, 328, 73, 25, $WS_GROUP)
    GUISetState(@SW_SHOW)


    While $L = 1
        $MSG = GUIGetMsg()
        Select
            Case $MSG = $GUI_EVENT_CLOSE
                Exit
            Case $MSG = $Next1
                GUIDelete($Form1)
                Sleep(750)
                $L = 2
                EULA()
            Case $MSG = $Cancel1
                Exit
        EndSelect
    WEnd
EndFunc   ;==>Begin


Func EULA()
    $Form1 = GUICreate("INSERTNAMEHERE - Installation Wizard", 537, 366, -1, -1)
    $Edit1 = GUICtrlCreateEdit("", -4, 0, 540, 57, BitOR($ES_READONLY, $ES_WANTRETURN))
    GUICtrlSetData(-1, "   End-User License Agreement")
    GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0x000000)
    GUICtrlSetBkColor(-1, 0xFFFFFF)
    $Edit2 = GUICtrlCreateEdit("", 24, 24, 305, 17, BitOR($ES_AUTOVSCROLL, $ES_AUTOHSCROLL, $ES_READONLY, $ES_WANTRETURN), 0)
    GUICtrlSetData(-1, "Please review the terms of service before installing INSERTNAMEHERE")
    GUICtrlSetBkColor(-1, 0xFFFFFF)
    $Next1 = GUICtrlCreateButton("Next >", 376, 328, 73, 25, BitOR($BS_DEFPUSHBUTTON, $WS_GROUP))
    $Back1 = GUICtrlCreateButton("< Back", 304, 328, 73, 25, $WS_GROUP)
    $Cancel1 = GUICtrlCreateButton("Cancel", 456, 328, 73, 25, $WS_GROUP)
;~  $Pic1 = GUICtrlCreatePic("\..\Icon.jpg", 480, 1, 55, 54, BitOR($SS_NOTIFY, $WS_GROUP))
;; Dont worry about the picture. :)
    $Edit3 = GUICtrlCreateEdit("", 24, 80, 481, 201, BitOR($ES_AUTOVSCROLL, $ES_AUTOHSCROLL, $ES_WANTRETURN, $WS_VSCROLL))
    GUICtrlSetData(-1, "http://www.developer-resource.com/sample-eula.htm")
    $Agree = GUICtrlCreateCheckbox("I accept the terms in the License Agreement.", 24, 296, 481, 25)
    GUICtrlSetState($Next1, $GUI_DISABLE)

    GUISetState(@SW_SHOW)

    While $L = 2
        If GUICtrlRead($Agree) = 1 Then
            If GUICtrlGetState($Next1) = 144 Then GUICtrlSetState($Next1, $GUI_ENABLE)
        ElseIf GUICtrlRead($Agree) = 4 Then
            If GUICtrlGetState($Next1) = 80 Then GUICtrlSetState($Next1, $GUI_DISABLE)
        EndIf
        $MSG = GUIGetMsg()
        Select
            Case $MSG = $GUI_EVENT_CLOSE
                Exit
            Case $MSG = $Back1
                GUIDelete($Form1)
                $L = 1
                Sleep(750)
                Begin()
            Case $MSG = $Next1
                GUIDelete($Form1)
                Sleep(750)
                $L = 3
                Info()
            Case $MSG = $Cancel1
                Exit
        EndSelect
    WEnd
EndFunc   ;==>EULA

Func Info()
    $Form1 = GUICreate("INSERTNAMEHERE - Installation Wizard", 537, 366, -1, -1)
    $Header = GUICtrlCreateEdit("", 0, 0, 536, 57, BitOR($ES_READONLY, $ES_WANTRETURN))
    GUICtrlSetData(-1, "   Account Registration")
    GUICtrlSetBkColor(-1, 0xFFFFFF)
    $Subheader = GUICtrlCreateEdit("", 24, 24, 385, 17, BitOR($ES_AUTOVSCROLL, $ES_AUTOHSCROLL, $ES_READONLY, $ES_WANTRETURN), 0)
    GUICtrlSetData(-1, "You must provide your real name, phone number, and address.")
    GUICtrlSetBkColor(-1, 0xFFFFFF)
    $Next1 = GUICtrlCreateButton("Next >", 376, 328, 73, 25, BitOR($BS_DEFPUSHBUTTON, $WS_GROUP))
    $Back1 = GUICtrlCreateButton("< Back", 304, 328, 73, 25, $WS_GROUP)
    $Cancel1 = GUICtrlCreateButton("Cancel", 456, 328, 73, 25, $WS_GROUP)
;~  $Pic1 = GUICtrlCreatePic("\..\Icon.jpg", 480, 1, 55, 54, BitOR($SS_NOTIFY, $WS_GROUP))
;; Dont worry about the picture. :)
    $peMail = GUICtrlCreateInput("", 232, 88, 241, 21)
    $pPassword = GUICtrlCreateInput("", 232, 120, 241, 21, BitOR($ES_PASSWORD, $ES_AUTOHSCROLL))
    $pName = GUICtrlCreateInput("", 232, 184, 241, 21)
    $pAddress = GUICtrlCreateInput("", 232, 216, 241, 21)
    $pCity = GUICtrlCreateInput("", 120, 253, 145, 21)
    $pState = GUICtrlCreateInput("", 328, 253, 25, 21)
    $pZipCode = GUICtrlCreateInput("", 432, 253, 41, 21)
    $pPhoneNumber = GUICtrlCreateInput("", 232, 290, 241, 21)
    $Label1 = GUICtrlCreateLabel("Before you continue you must create an account.", 16, 64, 237, 17)
    $LabelEmail = GUICtrlCreateLabel("Email Address:", 96, 92, 73, 17)
    $LabelPassword = GUICtrlCreateLabel("Password:", 96, 124, 53, 17)
    $Label2 = GUICtrlCreateLabel("Enter your personal information, fields with ( * ) are required.", 16, 156, 282, 17)
    $LabelName = GUICtrlCreateLabel("Fulle Name:", 96, 188, 60, 17)
    $LabelAddress = GUICtrlCreateLabel("Street Address:", 96, 220, 76, 17)
    $LabelCity = GUICtrlCreateLabel("City:", 96, 257, 24, 17)
    $LabelState = GUICtrlCreateLabel("State:", 288, 257, 32, 17)
    $LabelZip = GUICtrlCreateLabel("Zip Code:", 376, 257, 50, 17)
    $LabelPhone = GUICtrlCreateLabel("Phone Number:", 96, 294, 78, 17)
    $Asterisk = GUICtrlCreateLabel("*", 480, 184, 8, 17)
    $Label3 = GUICtrlCreateLabel("*", 480, 216, 8, 17)
    $Label4 = GUICtrlCreateLabel("*", 268, 256, 8, 17)
    $Label5 = GUICtrlCreateLabel("*", 356, 256, 8, 17)
    $Label6 = GUICtrlCreateLabel("*", 476, 256, 8, 17)
    GUISetState(@SW_SHOW)

    While $L = 3
        $MSG = GUIGetMsg()
        Select
            Case $MSG = $GUI_EVENT_CLOSE
                Exit
            Case $MSG = $Back1
                GUIDelete($Form1)
                $L = 2
                Sleep(750)
                EULA()
            Case $MSG = $Next1
                $eMail = GUICtrlRead($peMail)
                $Password = GUICtrlRead($pPassword)
                $Name = GUICtrlRead($pName)
                $Address = GUICtrlRead($pAddress)
                $City = GUICtrlRead($pCity)
                $State = GUICtrlRead($pState)
                $ZipCode = GUICtrlRead($pZipCode)
                $PhoneNumber = GUICtrlRead($pPhoneNumber)
                If $eMail = "" Then
                    MsgBox(48, "INSERTNAMEHERE", "You must enter your correct email address.")
                Else
                    If StringInStr($eMail, "@") < 2 Then
                        MsgBox(48, "INSERTNAMEHERE", "You must enter your correct email address.")
                    Else
                        If $Password = "" Then
                            MsgBox(48, "INSERTNAMEHERE", "Please create a minimum of a 6 character password.")
                        Else
                            If StringLen($Password) < 6 Then
                                MsgBox(48, "INSERTNAMEHERE", "Please create a minimum of a 6 character password.")
                            Else
                                If $Name = "" Then
                                    MsgBox(48, "INSERTNAMEHERE", "You must enter your real name.")
                                Else
                                    If StringIsDigit($Name) = 1 Then
                                        MsgBox(48, "INSERTNAMEHERE", "You must enter your real name using the English alphabet, 'A-Z'.")
                                    Else
                                        If StringInStr($Name, " ") = 0 Then
                                            MsgBox(48, "INSERTNAMEHERE", "You must enter your first and last name.")
                                        Else
                                            If $Address = "" Then
                                                MsgBox(48, "INSERTNAMEHERE", "You must enter your correct address.")
                                            Else
                                                If StringIsAlpha($Address) = 1 Then
                                                    MsgBox(48, "INSERTNAMEHERE", "Please enter your house number with your street name.")
                                                Else
                                                    If StringIsDigit($Address) = 1 Then
                                                        MsgBox(48, "INSERTNAMEHERE", "Please enter your street name after your house number.")
                                                    Else
                                                        If $City = "" Then
                                                            MsgBox(48, "INSERTNAMEHERE", "Please enter your city name.")
                                                        Else
                                                            If StringIsDigit($City) = 1 Then
                                                                MsgBox(48, "INSERTNAMEHERE", "Please enter your city name.")
                                                            Else
                                                                If $State = "" Then
                                                                    MsgBox(48, "INSERTNAMEHERE", "Please enter your state name.")
                                                                Else
                                                                    If StringLen($State) > 2 Then
                                                                        MsgBox(48, "INSERTNAMEHERE", "Please enter your states abbreviated name.")
                                                                    Else
                                                                        If StringLen($State) < 2 Then
                                                                            MsgBox(48, "INSERTNAMEHERE", "Please enter your states abbreviated name.")
                                                                        Else
                                                                            If StringIsDigit($State) Then
                                                                                MsgBox(48, "INSERTNAMEHERE", "Please enter your state name.")
                                                                            Else
                                                                                If $ZipCode = "" Then
                                                                                    MsgBox(48, "INSERTNAMEHERE", "Please enter your 5 digit zip code.")
                                                                                Else
                                                                                    If StringLen($ZipCode) > 5 Then
                                                                                        MsgBox(48, "INSERTNAMEHERE", "Please enter your 5 digit zip code, without the 4 digit extension.")
                                                                                    Else
                                                                                        If StringLen($ZipCode) < 5 Then
                                                                                            MsgBox(48, "INSERTNAMEHERE", "Please enter your 5 digit zip code.")
                                                                                        Else
                                                                                            GUIDelete($Form1)
                                                                                            Sleep(1500)
                                                                                            $L = 4
                                                                                            DrivePath()
                                                                                        EndIf
                                                                                    EndIf
                                                                                EndIf
                                                                            EndIf
                                                                        EndIf
                                                                    EndIf
                                                                EndIf
                                                            EndIf
                                                        EndIf
                                                    EndIf
                                                EndIf
                                            EndIf
                                        EndIf
                                    EndIf
                                EndIf
                            EndIf
                        EndIf
                    EndIf
                EndIf

            Case $MSG = $Cancel1
                $iMsgBoxAnswer = MsgBox(36, "Warning!", "Exiting the program will result in loss of unsaved data." & @CRLF & "Do you want to exit?")
                If $iMsgBoxAnswer = 6 Then Exit
        EndSelect
    WEnd
EndFunc   ;==>Info


Func DrivePath()
    $Form1 = GUICreate("INSERTNAMEHERE - Installation Wizard", 537, 366, 405, 180)
    $Header = GUICtrlCreateEdit("", 0, 0, 536, 57, BitOR($ES_READONLY, $ES_WANTRETURN))
    GUICtrlSetData(-1, "   Choose Install Location")
    GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
    GUICtrlSetColor(-1, 0x000000)
    GUICtrlSetBkColor(-1, 0xFFFFFF)
    $Subheader = GUICtrlCreateEdit("", 24, 24, 385, 17, BitOR($ES_AUTOVSCROLL, $ES_AUTOHSCROLL, $ES_READONLY, $ES_WANTRETURN), 0)
    GUICtrlSetData(-1, "Choose the drive to in which to install INSERTNAMEHERE.")
    GUICtrlSetBkColor(-1, 0xFFFFFF)
    $Next1 = GUICtrlCreateButton("Next >", 376, 328, 73, 25, BitOR($BS_DEFPUSHBUTTON, $WS_GROUP))
    $Back1 = GUICtrlCreateButton("< Back", 304, 328, 73, 25, $WS_GROUP)
    $Cancel1 = GUICtrlCreateButton("Cancel", 456, 328, 73, 25, $WS_GROUP)
;~  $Pic1 = GUICtrlCreatePic("\..\Icon.jpg", 480, 1, 55, 54, BitOR($SS_NOTIFY, $WS_GROUP))
;; Dont worry about the picture. :)
    $Label1 = GUICtrlCreateLabel("Setup will install INSERTNAMEHERE 3.4.1 in the following drive path. To install to a different folder, click Browse", 32, 72, 494, 17)
    $Label2 = GUICtrlCreateLabel("and choose the correct drive. Click Next to continue", 32, 88, 250, 17)
    $Label3 = GUICtrlCreateGroup("Destination Drive", 32, 192, 481, 57)
    $Path = GUICtrlCreateInput("E:\", 48, 216, 361, 21)
    $Browse = GUICtrlCreateButton("Browse", 424, 212, 73, 25, $WS_GROUP)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    $Group1 = GUICtrlCreateGroup("INSERTNAMEHERE 3.4.1", 13, 316, 510, 1, BitOR($WS_BORDER, $WS_CLIPSIBLINGS), BitOR($WS_EX_TRANSPARENT, $WS_EX_CLIENTEDGE, $WS_EX_STATICEDGE))
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    $Required = GUICtrlCreateLabel("Space Required: ---MB", 32, 296, 130, 17)
    GUICtrlSetState(-1, $GUI_DISABLE)
    GUISetState(@SW_SHOW)
    While $L = 4
        $MSG = GUIGetMsg()
        Select
            Case $MSG = $GUI_EVENT_CLOSE
                Exit
            Case $MSG = $Browse
                $DrivePath = FileSelectFolder("Select the USB Drive you wish to register and install upon:", @HomePath)
                GUICtrlSetData($Path, $DrivePath)
            Case $MSG = $Back1
                GUIDelete($Form1)
                $L = 3
                Sleep(750)
                Info()
            Case $MSG = $Next1
                $RemDrives = DriveGetDrive("REMOVABLE")
                If Not @error Then
                    For $i = 1 To $RemDrives[0]
                        $USBDrive = StringUpper($RemDrives[$i]) & "\"
                        If $DrivePath = $USBDrive Then
                            MsgBox(64, "INSERTNAMEHERE", "The path selected is recognized as a removable drive. (USB)" & @CRLF & "Insert next steps after this line.")
                            $L = 5
                        Else
                            ContinueLoop
                        EndIf
                    Next
                Else
                    MsgBox(48, "INSERTNAMEHERE", "No removable USB drive was detected, please try again.")
                EndIf
            Case $MSG = $Cancel1
                $iMsgBoxAnswer = MsgBox(36, "Warning!", "Exiting the program will result in loss of unsaved data." & @CRLF & "Do you want to exit?")
        EndSelect
    WEnd
EndFunc   ;==>DrivePath
Link to comment
Share on other sites

i suppose that would depend on what kind of a website you make.

some websites use databases, and some are plain html.

you could have autoit make a html file with some vars and auto upload it to the ftp.

but you can also have autoit run some sql queries and add posts to a website directly.

Edit~

well after seeing ur script i suppose you want something with user registration, so i think you are going to have a sql database with ur site.

im not a star with autoit / html i know bit of all so i cannot help much :S

Edited by Kage
Link to comment
Share on other sites

i suppose that would depend on what kind of a website you make.

some websites use databases, and some are plain html.

you could have autoit make a html file with some vars and auto upload it to the ftp.

but you can also have autoit run some sql queries and add posts to a website directly.

I'm willing to learn any language, but I do want the information to be as safe as possible; uploading individual files doesn't seem too secured.

Tell me which you prefer, and maybe direct me to some tutorials or website?

Thanks

EDIT: I also want the website to be user friendly, one thing I'm going to have for sure is a USB Setting page. (Since, after all, this is an installer for USB tools. I forgot to '#inclue <GUIConstants.au3>' in my code.

Edited by SNawazK786
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...