jvanegmond Posted September 15, 2009 Share Posted September 15, 2009 You are writing the control IDs to the ini. You should read data from the control first, and then put it in the ini. : ) IniWrite("C:\myfile.ini", "section1", "key", GUICtrlRead($UserName)) IniWrite("C:\myfile.ini", "section2", "key", GUICtrlRead($PassWord)) github.com/jvanegmond Link to comment Share on other sites More sharing options...
Phaser Posted May 12, 2010 Share Posted May 12, 2010 Hi Manadar Hope you can help me get this working, I am using your mysql/php login bits n pieces, all fine so far but don't seem to be picking up the Func IsValidSession($s) Return $s == "VALID LOGIN" EndFunc If I login via a browser it works and prints VALID LOGIN to the page how do I pick that up within my autoit script? Link to comment Share on other sites More sharing options...
ForsakenGod Posted May 12, 2010 Share Posted May 12, 2010 (edited) Post up a bit more info and your code ? Edited May 12, 2010 by ForsakenGod Link to comment Share on other sites More sharing options...
Phaser Posted May 12, 2010 Share Posted May 12, 2010 Hi OK here's the code I am using in my script $username = "uname" $password = "pword" $session = InetGet("http://www.domain.com/login.php?username=" & $username & "&password=" & $password) If (IsValidSession($session)) Then ; Logged in Else Exit EndIf Func IsValidSession($s) Return $s == "VALID LOGIN" EndFunc The web site has the user setup and works via a browser, and when accessed display VALID LOGIN on the page (login.php) Manadar supplied the following code // make a connection to the database running on the webserver mysql_connect("localhost", "dbuser", "dbpass", "dbname"); $username = $_GET['username']; $password = $_GET['password']; $query = "SELECT * FROM users WHERE username = '" . mysql_real_escape_string($username) . "' AND password = ''"; $result = mysql_query($query); if ($result) then echo "VALID LOGIN"; // and this would tell the Au3 script that the user exists end But as this part has autoit code and NOT php code it can't print/echo it out. if ($result) then echo "VALID LOGIN"; // and this would tell the Au3 script that the user exists end So I changed the php page to this instead if (mysql_num_rows($result) == '1') { print "VALID LOGIN"; } else { print "Uh Oh"; } Any help is much appreciated Link to comment Share on other sites More sharing options...
Phaser Posted May 17, 2010 Share Posted May 17, 2010 With all the above in place does anybody know how I can tell my script that the user exists? Link to comment Share on other sites More sharing options...
Phaser Posted May 26, 2010 Share Posted May 26, 2010 (edited) Hate to bump threads back to the front but I really could do with an answer guys, in short, user is setup in mysql db and works fine through a browser, it prints VALID LOGIN to the php page on success. How do I tell autoit exe that the result is good to go? Edited May 26, 2010 by Phaser Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now