Discord Server Red Security Twitter Donation to Red Security Red Security Youtube Channel Red Security Tumblr Profile
Windscribe
Login or Register to Hide ads and Accessing all features on the forum
Thread Rating:
  • 9 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
vb.net php database login
#1
Code:
<?php

/* Connent Database */
$con = new mysqli('localhost', 'dbuser', 'db password', 'dbname');
$con->set_charset('utf-8');
if ($con->connect_error) {
    die($con->connect_error);
}

$action = ($_GET['action'] != null) ? $_GET['action'] : null;
$username = ($_GET['username'] != null) ? $_GET['username'] : null;
$password = ($_GET['password'] != null) ? $_GET['password'] : null;



if ($action != '' && $username != '' && $password != '') {
    switch ($action) {
        case 'register':
            $result = $con->query("SELECT * FROM member WHERE username='{$username}'");
            if ($result->num_rows == 0) {
                $con->query("INSERT INTO make_your_table_name (username,password) VALUES ('{$username}','{$password}')");
                echo 'success';
            } else {
                echo 'Plase Try Again.';
            }
            break;
        case 'login':
            $result = $con->query("SELECT * FROM grabinfo WHERE username='{$username}' AND password='{$password}'");
            if ($result->num_rows > 0) {
                echo 'success';
            } else {
                echo 'incorrect';
            }
            break;

        default:
            echo 'invalid action';
            break;
    }


}

vb.net code
2 textboxes 2 buttons
button1 text reg_user
button2 name login_user
textbox1.text
textbox2.text
form1.vb

Code:
Public Class Form1

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Dim webbrowser1 As New WebBrowser
        webbrowser1.Navigate("https://haxcore.net/try10/reg_user.php?action=register&username=" & TextBox1.Text & "&password=" & TextBox2.Text)

        Do While webbrowser1.ReadyState <> WebBrowserReadyState.Complete
            Application.DoEvents()
        Loop
        If webbrowser1.DocumentText.Contains("success") Then
            MessageBox.Show("User successfully registered, you can now log in", "E-mail / username already exists", MessageBoxButtons.OK, MessageBoxIcon.Error)

            ' Me.Hide()
        ElseIf webbrowser1.DocumentText.Contains("FINISHED") Then
            MessageBox.Show("This e-mail and / or the username already exists in our database!", "Registration successful", MessageBoxButtons.OK, MessageBoxIcon.Information)
        End If
    End Sub

    Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
        Dim wClient As New System.Net.WebClient
        Dim result As String = wClient.DownloadString("https://haxcore.net/try10/reg_user.php?action=login&username=" + TextBox1.Text + "&password=" + TextBox2.Text)
        If result = "success" Then
            MessageBox.Show("Login Success", "", MessageBoxButtons.OK, MessageBoxIcon.Information)
        Else
            MessageBox.Show("Username And Password Incorrect.", "", MessageBoxButtons.OK, MessageBoxIcon.Warning)
        End If
    End Sub
End Class

reg_user output
   

login_user output
   

got to line number 24 in form1.vb hit enter use arrow key up then add form2.show
[img=0x0]https://hackmyass.files.wordpress.com/2011/01/hackers.jpg[/img]
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  vb.net mybb login system viruss 3 2,230 08-04-2017, 04:51 PM
Last Post: DarkCode



Users browsing this thread: 1 Guest(s)