Hi,
as far as I know AutoIT itself only supports SQLite,
but there´s an MySQL UDF to solve it.
If you include the MySQL UDF, you can connect on the MySQL-Server,
additionally the UDF supports a _Query()-function, so you can use regular SQL-Statements.
But I would advise you to write php-files for the SQLConnection.
PHP File:
Code:
<?php
$host = 'yourhost';
$user = 'dbusername';
$pass = 'dbpassword';
$dbase = 'yourdatabase';
mysql_connect($host, $user, $pass);
mysql_select_db($dbase);
$sUsername = mysql_real_escape_string($_GET['username'];
$sPassword = md5(mysql_real_escape_string($_GET['password']));
$result = mysql_query("SELECT id FROM TABLE WHERE username = '" . $sUsername . "' AND password = '" . $sPassword . "'"); // Your SQL Statement
$row = mysql_fetch_row($result);
if ($row) {
echo 1;
} else {
echo 0;
}
?>
The AutoIT-Code:
Code:
#include <INet.au3>
$user = InputBox("Login", "Please enter your username", "", "")
$pass = InputBox("Login", "Please enter your password", "", "")
$iRValue = _INetGetSource("http://yourdomain.de/your.php?username=" & $user & "&password=" & $pass)
if $iRValue = 1 Then
; Login Successfully
ElseIf $iRValue = 2 Then
; Login Failed
EndIf
If you Connect to your datebase directly from AutoIT, you need your MySQL-Connection data in your au3-file,
but autoit-scripts aren´t really hard to decompile, so everyone who decompile your scripts can connect on your database.
To upload something, you can use the FTP-protocol,
to connect you need login data to the ftp server.
The only way to connect / upload without data is, if your ftp-server accept guest login and the guest becomes permissions to write data (I wouldn´t recommend it).