








<?php
$connect = mysql_connect("localhost","crorib_admin","userpassword");//Replace the crorib_admin with your username and userpassword with the password you are using for that user. This line connects to the MySQL engine.
if($connect)
{
$TableQuery="CREATE TABLE users (Username varchar(255), Serial varchar(500))"; //This line defines a MySQL query which creates a table named "users" that has the two columns. 1: Username (which can store maximum of 255 characters). 2: Serial (which can store maximum of 500 characters).
$select = mysql_select_db("crorib_serials",$connect); //Replace crorib_serials with the name of the database you created. This line selects the database in which we want to add our new table.
if($select)
{
if(mysql_query($TableQuery)) //This line tries to execute the query we created above. If the table is created successfully, it returns true. Otherwise, it returns false.
{
die ('Table created successfully. You can delete setup.php now.'); //Display a success message and exit.
}
else
{
die ("Failed to create the table. " . mysql_error()); //Display failure message and exit.
}
}
else
{
die("Unable to select database." . mysql_error()); //Unable to select the database. Display failure message and exit.
}
}
else
{
echo 'Failed to connect.' . mysql_error(); //Failed to connect. Display failure message and exit.
}
?>









<?php
if($_POST) //Make sure it is a post request.
{
if(isset($_POST["username"]) && isset($_POST["serial"])) //Make sure username and serial are provided.
{
$connect = mysql_pconnect("localhost","crorib_admin","yourusername"); //Connect to the database. //Replace the crorib_admin with your username and userpassword with the password you are using for that user. This line connects to the MySQL engine.
if($connect) //If successfully connected.
{
$select = mysql_select_db("crorib_serials",$connect); //Select the database you created. Replace crorib_serials with your database name.
if($select)
{
$user = mysql_escape_string($_POST["username"]); //Variable user that stores our username that was passed as a post request.
$serial = mysql_escape_string($_POST["serial"]); //Variable serial that stores our serial name for the user that was passed as a post request.
$NewUser = "INSERT INTO users VALUES ('$user','$serial')"; //MySQL query that adds the username and serial to the table.
if(mysql_query($NewUser)) //If added successfully
{
die("User added successfully."); //Display success message and exit.
}
else
{
die("Unable to add user to the database." . mysql_error()); //Unable to add the user. Display failure message and exit.
}
}
else
{
die("Unable to select database." . mysql_error()); //Unable to select the database. Display failure message and exit.
}
}
else
{
die("Unable connect to database." . mysql_error()); //Unable to connect to database. Display failure message and exit.
}
}
else
{
die("Access Denied!"); //Not a post request. Display Access Denied and exit.
}
}
else
{
die("Access Denied!"); //Not a post request. Display Access Denied and exit.
}
?>
<?php
if($_POST) //Make sure it is a post request.
{
if(isset($_POST["username"]) && isset($_POST["serial"])) //Make sure username and serial are provided.
{
$connect = mysql_pconnect("localhost","crorib_admin","userpassword"); //Connect to the database. //Replace the crorib_admin with your username and userpassword with the password you are using for that user. This line connects to the MySQL engine.
if($connect) //If successfully connected.
{
$select = mysql_select_db("crorib_serials",$connect); //Select the database you created. Replace crorib_serials with your database name.
if($select)
{
$user = mysql_escape_string($_POST["username"]); //Variable user that stores our username that was passed as a post request.
$serial = mysql_escape_string($_POST["serial"]); //Variable serial that stores our serial name for the user that was passed as a post request.
$GetRows = mysql_query("SELECT * FROM users WHERE Username='$user' AND Serial='$serial'"); //MySQL query that adds the username and serial to the table.
$RowCount=mysql_num_rows($GetRows); //Count the number of results we have.
if($RowCount>0)
{
die("Correct !");
}
else
{
die("Incorrect !");
}
}
else
{
die("Unable to select database." . mysql_error()); //Unable to select the database. Display failure message and exit.
}
}
else
{
die("Unable connect to database." . mysql_error()); //Unable to connect to database. Display failure message and exit.
}
}
else
{
die("Access Denied!"); //Not a post request. Display Access Denied and exit.
}
}
else
{
die("Access Denied!"); //Not a post request. Display Access Denied and exit.
}
?>
<?php
if($_POST) //Make sure it is a post request.
{
if(isset($_POST["username"]) && isset($_POST["serial"])) //Make sure username and serial are provided.
{
$connect = mysql_pconnect("localhost","crorib_admin","userpassword"); //Connect to the database. //Replace the crorib_admin with your username and userpassword with the password you are using for that user. This line connects to the MySQL engine.
if($connect) //If successfully connected.
{
$select = mysql_select_db("crorib_serials",$connect); //Select the database you created. Replace crorib_serials with your database name.
if($select)
{
$user = mysql_escape_string($_POST["username"]); //Variable user that stores our username that was passed as a post request.
$serial = mysql_escape_string($_POST["serial"]); //Variable serial that stores our serial name for the user that was passed as a post request.
$DeleteUser = "DELETE FROM users WHERE Username='$user' AND Serial='$serial'"; //MySQL query that deletes the username and serial from the table.
if(mysql_query($DeleteUser)) //If deleted successfully
{
die("User deleted successfully."); //Display success message and exit.
}
else
{
die("Unable to delete user from the database." . mysql_error()); //Unable to add the user. Display failure message and exit.
}
}
else
{
die("Unable to select database." . mysql_error()); //Unable to select the database. Display failure message and exit.
}
}
else
{
die("Unable connect to database." . mysql_error()); //Unable to connect to database. Display failure message and exit.
}
}
else
{
die("Access Denied!"); //Not a post request. Display Access Denied and exit.
}
}
else
{
die("Access Denied!"); //Not a post request. Display Access Denied and exit.
}
?>





Imports System.Net Imports System.Text Imports System.Web

Function CheckUser(AuthenticationPage As String, Username As String, Serial As String) As Boolean
Dim wc As New WebClient()
wc.Headers.Add("Content-Type", "application/x-www-form-urlencoded")
Dim Data As String = String.Format("username={0}&serial={1}", HttpUtility.UrlEncode(Username), HttpUtility.UrlEncode(Serial))
Dim ResponseBytes() As Byte = wc.u p l o a d data(AuthenticationPage, "POST", Encoding.ASCII.GetBytes(Data))
Dim Response As String = Encoding.ASCII.GetString(ResponseBytes)
If Response.Contains("Correct") Then
Return True
Else
Return False
End If
End Function
Function AddUser(StoragePage As String, Username As String, Serial As String) As Boolean
Dim wc As New WebClient()
wc.Headers.Add("Content-Type", "application/x-www-form-urlencoded")
Dim Data As String = String.Format("username={0}&serial={1}", HttpUtility.UrlEncode(Username), HttpUtility.UrlEncode(Serial))
Dim ResponseBytes() As Byte = wc.u p l o a d data(StoragePage, "POST", Encoding.ASCII.GetBytes(Data))
Dim Response As String = Encoding.ASCII.GetString(ResponseBytes)
If Response.Contains("User added") Then
Return True
Else
Return False
End If
End Function
Function DeleteUser(DeletionPage As String, Username As String, Serial As String) As Boolean
Dim wc As New WebClient()
wc.Headers.Add("Content-Type", "application/x-www-form-urlencoded")
Dim Data As String = String.Format("username={0}&serial={1}", HttpUtility.UrlEncode(Username), HttpUtility.UrlEncode(Serial))
Dim ResponseBytes() As Byte = wc.u p l o a d data(DeletionPage, "POST", Encoding.ASCII.GetBytes(Data))
Dim Response As String = Encoding.ASCII.GetString(ResponseBytes)
If Response.Contains("User deleted") Then
Return True
Else
Return False
End If
End Function

If CheckUser("http://mysite.com/authentication/load.php", login_username.Text, login_password.Text) Then
'Do whatever you want to do on successful login here.
MsgBox("You have successfully logged in.")
Else
'Do whatever you want to do on un-successful login here.
MsgBox("You have provided invalid username or password. Unable to login.")
End If

Function GenerateRandom(length As Integer) As String
Dim Rand As New Random()
Dim Allowed() As Char = "0123456789abcdefghijklmnopqrstuvwxyz"
Dim SB As New System.Text.StringBuilder
Do
SB.Append(Allowed(Rand.Next(0, Allowed.Length)))
Loop Until SB.Length = length
Return SB.ToString
End Function
Dim NewSerial As String = ""
Sub SendEmail(sendersemail As String, senderspassword As String, emailusername As String, username As String)
Dim Title As String = "Your Password for my software xxx"
Dim Body As String = "Dear " & username & "," & vbCrLf & "Thank you for registering with my software xxx. Your password is: " & vbCrLf & NewSerial & vbCrLf & vbCrLf & "Regards," & vbCrLf & "Pedophile !"
Dim Message As New Net.Mail.MailMessage(sendersemail, emailusername, Title, Body)
Dim SMTP As New Net.Mail.SmtpClient("smtp.gmail.com", 587)
SMTP.Credentials = New Net.NetworkCredential(sendersemail, senderspassword)
SMTP.EnableSsl = True
SMTP.Timeout = 100000
SMTP.Send(Message)
End Sub
If (String.IsNullOrEmpty(reg_username.Text.Trim())) Then
MsgBox("Username cannot be empty.")
Exit Sub
End If
NewSerial = GenerateRandom(10) 'Replace 10 with the desired length of the password.
If (AddUser("http://mysite.com/authentication/store.php", reg_username.Text, NewSerial)) Then
MsgBox("You are now added to the database. Sending you your password now on your email address.")
SendEmail("myemailaddress@gmail.com", "mygmailaccountpassword", reg_email.Text, reg_username.Text) 'Replace first two parameters with your credentials.
Else
MsgBox("Something went wrong. Unable to add you to database.")
End If




function db_escape($values, $quotes = true) {
if (is_array($values)) {
foreach ($values as $key => $value) {
$values[$key] = db_escape($value, $quotes);
}
}
else if ($values === null) {
$values = 'NULL';
}
else if (is_bool($values)) {
$values = $values ? 1 : 0;
}
else if (!is_numeric($values)) {
$values = mysql_real_escape_string($values);
if ($quotes) {
$values = "'" . $values . "'";
}
}
return $values;
}
$_POST = db_escape($_POST,true);

<?php
$mysql_host = "localhost";
$mysql_username = "crorib_admin";
$mysql_password = "password";
$mysql_database = "crorib_serials";
$connect = mysql_connect($mysql_host, $mysql_username, $mysql_password);
if($connect) {
$select = $mysql_select_db($mysql_database, $connect);
if($select) {
$query = "CREATE TABLE users (username varchar(255), serial varchar(500))";
if(mysql_query($query)); {
die ('Table created successfully. You can delete setup.php now.');
} else {
die ("Failed to create the table. ".mysql_error());
}
} else {
die("Unable to select database.".mysql_error());
}
} else {
die('Failed to connect.'.mysql_error());
}
?>
<?php
$mysql_host = "localhost";
$mysql_username = "crorib_admin";
$mysql_password = "password";
$mysql_database = "crorib_serials";
$username = $_POST['username'];
$serial = $_POST['serial];
if(isset($username) && isset($serial")) {
$connect = mysql_connect($mysql_host, $mysql_username, $mysql_password);
if($connect) {
$select = mysql_select_db($mysql_database, $connect);
if($select) {
$query = "INSERT INTO users VALUES (mysql_escape_string($username), mysql_escape_string(serial))";
if(mysql_query($query)) {
die("User added successfully.");
} else {
die("Unable to add user to the database.".mysql_error());
}
} else {
die("Unable to select database.".mysql_error());
}
} else {
die("Unable connect to database.".mysql_error());
}
} else {
die("Access Denied!");
}
?>