<?php
$host = 'localhost';
$user = 'root';
$pass = '';
$dbase = 'test123';
$con = mysqli_connect($host, $user, $pass, $dbase);
// Check connection
if (mysqli_connect_errno()) {
echo "Failed to connect to MySQL";
} else {
// check is email is in a link
if (isset($_GET['email'])) {
// protect email from mysql injection
$email = mysqli_real_escape_string($con, $_GET['email']);
// cleaned data
$email = clean_data($email);
// get email from database
$result = mysqli_query($con, "SELECT * FROM accounts WHERE email = '".$email."'");
if (mysqli_num_rows($result) > 0) {
echo 'ok';
}
mysqli_close($con); // close connection
}
}
// function to clean variable to prevent xss and code injection
function clean_data($data)
{
$invalid_characters = array("$", "%", "#", "<", ">", "|");
$data = strip_tags($data);
$data = trim($data);
$data = str_replace($invalid_characters, "", $data);
return $data;
}
?>
AutoIt code made with your example
Code:
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <INet.au3>
#include <IE.au3>
#region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Send Text", 250, 162, 192, 124)
$Button1 = GUICtrlCreateButton("Send", 80, 128, 97, 25)
$Input1 = GUICtrlCreateInput("", 48, 32, 161, 21)
$Label1 = GUICtrlCreateLabel("Email", 112, 8, 23, 17)
GUISetState(@SW_SHOW)
#endregion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
checkLogin()
EndSwitch
WEnd
Func checkLogin()
Local $mail = GUICtrlRead($Input1) ; read email from input
Local $url = "http://playgame4.net/123.php?email=" ; url to check
Local $value = _INetGetSource ($url & $mail) ; get url with data
; check for value
If $value == 'ok' Then
MsgBox(0, "", "Valid email")
Else
MsgBox(0, "", "Invalid email")
EndIf
EndFunc
U can test, i made 2 emails
oh that work but in table i have 2 colume
email and serial.
if me check email it will back to send serial to check that email and serial are correct. How to make it?
serial = drivegetserial
why i check on my link Result=invalid
i tested on free host that all in valid
Quote:
Func checkLogin()
Local $mail = GUICtrlRead($Input1) ; read email from input
Local $url = "http://neowkickclick.siam.im/check.php?email=" ; url to check
Local $value = _INetGetSource ($url & $mail) ; get url with data
; check for value
If $value == 'ok' Then
MsgBox(0, "", "Valid email")
Else
MsgBox(0, "", "Invalid email")
EndIf
Then u need to change all, so what exactly that script need to do ? You can add me on skype ( mario.lukacic.or ) if u have it, or facebook so i can explain u better.
Then u need to change all, so what exactly that script need to do ? You can add me on skype ( mario.lukacic.or ) if u have it, or facebook so i can explain u better.
it is not safe to use connection to dbs in script (possibility of decompiling). Use php and then send GET request to some php file(which will echo what u want). And then autoit can read that echo-ed text with:
$TextFromPHP= _INetGetSource("www.page.php")
it is not safe to use connection to dbs in script (possibility of decompiling). Use php and then send GET request to some php file(which will echo what u want). And then autoit can read that echo-ed text with:
$TextFromPHP= _INetGetSource("www.page.php")
Did u see what i wrote ? There is nothing in autoit code on in php script on server, when u access it its like u access over normal webpage so there is no problem.
Did u see what i wrote ? There is nothing in autoit code on in php script on server, when u access it its like u access over normal webpage so there is no problem.
sorry...I didnt read your code....I wrote it in general
Autoit How do I connect to MySQL? 05/13/2013 - AutoIt - 3 Replies Autoit How do I connect to MySQL?
The like of which you do not.
Like this Olympus Team Tutorial - YouTube
Please ask for it.