UPDATED
PHP code
Code:
<?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
[Only registered and activated users can see links. Click Here To Register...]
[Only registered and activated users can see links. Click Here To Register...]