Jump to content

php & autoit for mysql


emoyasha
 Share

Recommended Posts

Ok well i figured that i would rather not install the OCDB connect on the pc of every user using the web messenge rim creating. i also decided i didnt want a server application running on my computer, however i have a linux VPS for $241 a year. so i wrote a php page and this autoit script, the autoitscript uses inet functions to login using GET well here is the autoit, you will need MD5hash.DLL and 230221413.jpg [included] php release soon. THIS IS NOT A FINISHED SCRIPT its only the begning that i whipped up in about 4/5 minutes.

what it does

1)checks login

2)downloads user display pic [for use on the login screen of the app(liek msn)]

3)tells you if the login exists.

Username: autoit

password: autoit

tell me if it works and whut u think.

#include <GUIConstants.au3>
#include <Inet.au3>
#include <string.au3>
Global $ES_PASSWORD
Global $ES_AUTOHSCROLL
Global $GUI_SS_DEFAULT_BUTTON
Global $BS_CENTER 
AutoItSetOption("MustDeclareVars", 0)
#AutoIt3Wrapper_plugin_funcs = MD5Hash
#AutoIt3Wrapper_plugin_funcs = SHAHash
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("YourSpace Web Messenger", 266, 557, 193, 125)
GUISetCursor (3)
$picloc = IniRead("sets.ini", "prof", "pic", "230221413.jpg")
$usern = IniRead("sets.ini", "prof", "login", "UserName")
$passw = IniRead("sets.ini", "prof", "pass", "")
$pass2 = _StringEncrypt(0, $passw, "yourspace")

$Pic1 = GUICtrlCreatePic($picloc, 80, 56, 116, 116)
$Graphic1 = GUICtrlCreateGraphic(64, 40, 148, 148)
GUICtrlSetColor(-1, 0x1A1A1A)
GUICtrlSetBkColor(-1, 0xA6CAF0)
$User = GUICtrlCreateInput($usern, 56, 208, 153, 21)
$Input2 = GUICtrlCreateInput($pass2, 56, 240, 153, 21, 0x0020)
$login = GUICtrlCreateButton("Log In", 96, 280, 75, 25, BitOR($GUI_SS_DEFAULT_BUTTON, $BS_CENTER ))
$Label1 = GUICtrlCreateLabel("Register For An Account", 72, 368, 120, 17)
$Label2 = GUICtrlCreateLabel("Forgot Your Password?", 72, 400, 114, 17)
$Avi1 = GUICtrlCreateAvi("No File", -1, 16, 448, 233, 81)

GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        case $login
            $plH = PluginOpen("MD5Hash.dll")
            $md5 = MD5Hash(GUICtrlRead($Input2), 2, True)
            $md5 = StringLower ( $md5 )
            
            
            PluginClose($plH)
            $login = _INetGetSource("http://notmyspace.info/check2.php?login="&GUICtrlRead($User)&"&pass="&$md5)
            $login = StringSplit($login,"\")
            $picdl = StringSplit($login[2],".")
            

            if $login[1] = "YES" Then
                            inetget($login[2], "pic."&$picdl[3])
            IniWrite("sets.ini","prof","pic","pic."&$picdl[3])
            IniWrite("sets.ini","prof","login",GUICtrlRead($User))
            IniWrite("sets.ini","prof","pass",_StringEncrypt(1, GUICtrlRead($Input2), "yourspace"))
                msgbox(64, "Yes", "login sucessfull")
                Exit
                
                Else
                msgbox(64, "No", "login unsucessfull")
            exit
EndIf
    EndSwitch
WEnd

MD5Hash.dll

post-31056-1215497652_thumb.jpg

Edited by emoyasha
Spoiler

Admin Of:http://notmyspace.info [Under Development, looking for volunteers to help improve]http://PSNetCards.co.ukhttp://ZacnAndLindsey.com [Under development, not quite sure what to do with it yet]http://revelm.com------------------------------------Radio Streams:http://75.185.53.88:8000 [128kb/s 44kHz]http://75.185.53.88:8002 [22kb/s 22kHz](works on mobile phones)-----------------------------------My Server:Owned By: http://jumpline.comIP:66.84.19.220Bandwidth:200GBStorage Space:1TBNetwork Connection: 1GB/S[up and down]Operating System: Red Hat LinuxInstalled Apps:Webmail, phpBB, Majordomo, phpMyAdmin, MySQL, Active Server Pages, FrontPage Extensions 2002, GraphicsMagick, Mod Perl, Perl, PHP: Hypertext Preprocessor, Python(want cheap good webhosting, or need a place to park your domain? contact me)-----------------------------------

 

Link to comment
Share on other sites

--reserved--

Edited by emoyasha
Spoiler

Admin Of:http://notmyspace.info [Under Development, looking for volunteers to help improve]http://PSNetCards.co.ukhttp://ZacnAndLindsey.com [Under development, not quite sure what to do with it yet]http://revelm.com------------------------------------Radio Streams:http://75.185.53.88:8000 [128kb/s 44kHz]http://75.185.53.88:8002 [22kb/s 22kHz](works on mobile phones)-----------------------------------My Server:Owned By: http://jumpline.comIP:66.84.19.220Bandwidth:200GBStorage Space:1TBNetwork Connection: 1GB/S[up and down]Operating System: Red Hat LinuxInstalled Apps:Webmail, phpBB, Majordomo, phpMyAdmin, MySQL, Active Server Pages, FrontPage Extensions 2002, GraphicsMagick, Mod Perl, Perl, PHP: Hypertext Preprocessor, Python(want cheap good webhosting, or need a place to park your domain? contact me)-----------------------------------

 

Link to comment
Share on other sites

ok... now i need some help, now it logs in and fetches all contacts for a user, then adds then to a tree view, and i want a user to be able to double click, to bring up a meesage box display the user they clicked, or to be able to right click and select "message" and it bring up a message box with their username. could whoever helps please comment how this is done, i only need a message box because i want help making an action happen based on what user is clicked, i can write the actual messaging and stuff myself.

#include <GUIConstants.au3>
#include <Inet.au3>
#include <string.au3>

AutoItSetOption("MustDeclareVars", 0)
#AutoIt3Wrapper_plugin_funcs = MD5Hash
#AutoIt3Wrapper_plugin_funcs = SHAHash
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("YourSpace Web Messenger", 266, 557, 193, 125)
GUISetCursor (3)
$picloc = IniRead("sets.ini", "prof", "pic", "230221413.jpg")
$usern = IniRead("sets.ini", "prof", "login", "UserName")
$passw = IniRead("sets.ini", "prof", "pass", "")
$pass2 = _StringEncrypt(0, $passw, "yourspace")

$Pic1 = GUICtrlCreatePic($picloc, 80, 56, 116, 116)
$Graphic1 = GUICtrlCreateGraphic(64, 40, 148, 148)
GUICtrlSetColor(-1, 0x1A1A1A)
GUICtrlSetBkColor(-1, 0xA6CAF0)
$User = GUICtrlCreateInput($usern, 56, 208, 153, 21)
$Input2 = GUICtrlCreateInput($pass2, 56, 240, 153, 21, 0x0020)
$login = GUICtrlCreateButton("Log In", 96, 280, 75, 25, BitOR($GUI_SS_DEFAULT_BUTTON, $BS_CENTER ))
$Label1 = GUICtrlCreateLabel("Register For An Account", 72, 368, 120, 17)
$Label2 = GUICtrlCreateLabel("Forgot Your Password?", 72, 400, 114, 17)
$Avi1 = GUICtrlCreateAvi("No File", -1, 16, 448, 233, 81)

GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        case $login
            $plH = PluginOpen("MD5Hash.dll")
            $md5 = MD5Hash(GUICtrlRead($Input2), 2, True)
            $md5 = StringLower ( $md5 )
           
           
            PluginClose($plH)
            $login = _INetGetSource("http://notmyspace.info/check2.php?login="&GUICtrlRead($User)&"&pass="&$md5)
            $login = StringSplit($login,"\")
            
           

            if $login[1] = "YES" Then
                $picdl = StringSplit($login[2],".")
                            inetget($login[2], "pic."&$picdl[3])
            IniWrite("sets.ini","prof","pic","pic."&$picdl[3])
            IniWrite("sets.ini","prof","login",GUICtrlRead($User))
            IniWrite("sets.ini","prof","pass",_StringEncrypt(1, GUICtrlRead($Input2), "yourspace"))
                msgbox(64, "Yes", "login sucessfull")
                GUIDelete()
                $Form1 = GUICreate("YourSpace Web Messenger", 266, 557, 193, 125)
GUISetCursor (3)
$treeview = GUICtrlCreateTreeView(-1, -1, 266, 557)
                $contacts   = GUICtrlCreateTreeViewitem("Contacts", $treeview)
                 $cnt = _INetGetSource("http://notmyspace.info/check2.php?act=cont2")
                 $cnt = StringSplit($cnt, " ")
                 $x = UBound($cnt)
                 msgbox(64, "", $x)
                 $y = 1
                
                do
                    
                $contact  = GUICtrlCreateTreeViewitem($cnt[$y], $contacts)
               $y = $y + 1
               
           until $y = $x
           GUISetState(@SW_SHOW)
           While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $nMsg = $contact
            
            EndSwitch
        WEnd
        
           
                Else
                msgbox(64, "No", "login unsucessfull")
            exit
EndIf
    EndSwitch
WEnd
Spoiler

Admin Of:http://notmyspace.info [Under Development, looking for volunteers to help improve]http://PSNetCards.co.ukhttp://ZacnAndLindsey.com [Under development, not quite sure what to do with it yet]http://revelm.com------------------------------------Radio Streams:http://75.185.53.88:8000 [128kb/s 44kHz]http://75.185.53.88:8002 [22kb/s 22kHz](works on mobile phones)-----------------------------------My Server:Owned By: http://jumpline.comIP:66.84.19.220Bandwidth:200GBStorage Space:1TBNetwork Connection: 1GB/S[up and down]Operating System: Red Hat LinuxInstalled Apps:Webmail, phpBB, Majordomo, phpMyAdmin, MySQL, Active Server Pages, FrontPage Extensions 2002, GraphicsMagick, Mod Perl, Perl, PHP: Hypertext Preprocessor, Python(want cheap good webhosting, or need a place to park your domain? contact me)-----------------------------------

 

Link to comment
Share on other sites

just so you know... you don't need to install the odbc on all the clients (allowing clients to connect to your db directly is very unsafe anyway), you only need to install the odbc driver on the server muttley

Only two things are infinite, the universe and human stupidity, and i'm not sure about the former -Alber EinsteinPractice makes perfect! but nobody's perfect so why practice at all?http://forum.ambrozie.ro

Link to comment
Share on other sites

i am aware. could someone help me?

Spoiler

Admin Of:http://notmyspace.info [Under Development, looking for volunteers to help improve]http://PSNetCards.co.ukhttp://ZacnAndLindsey.com [Under development, not quite sure what to do with it yet]http://revelm.com------------------------------------Radio Streams:http://75.185.53.88:8000 [128kb/s 44kHz]http://75.185.53.88:8002 [22kb/s 22kHz](works on mobile phones)-----------------------------------My Server:Owned By: http://jumpline.comIP:66.84.19.220Bandwidth:200GBStorage Space:1TBNetwork Connection: 1GB/S[up and down]Operating System: Red Hat LinuxInstalled Apps:Webmail, phpBB, Majordomo, phpMyAdmin, MySQL, Active Server Pages, FrontPage Extensions 2002, GraphicsMagick, Mod Perl, Perl, PHP: Hypertext Preprocessor, Python(want cheap good webhosting, or need a place to park your domain? contact me)-----------------------------------

 

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...