Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [align=center]What you will need:
- A basic understand of PHP and VB.net.
- A webhost / vps to host the PHP scripts on
- An mysql database
- Start:
- Setting Up The Database:
- First things first you will need to create a new database. After creating the database insert a new table called "users" with 2 columns name these 2 columns "username" and "password"
- The PHP scripts:
- You will need to create 2 new files, config.php and login.php
- Config.php
- [php]
- <?php
- $connection = mysqli_connect('localhost', 'username', 'password');
- if (!$connection){
- die("Database Connection Failed" . mysqli_error($connection));
- }
- $select_db = mysqli_select_db($connection, 'database name');
- if (!$select_db){
- die("Database Selection Failed" . mysqli_error($connection));
- }
- ?>
- [/php]
- Login.php
- [php]
- <?php
- include "config.php";
- $username = htmlspecialchars(mysqli_real_escape_string($connection, $_GET['username']));
- $password = htmlspecialchars(mysqli_real_escape_string($connection, $_GET['password']));
- $query = "SELECT * FROM `users` WHERE username='$username' and password='$password'";
- $result = mysqli_query($connection, $query) or die(mysqli_error($connection));
- $count = mysqli_num_rows($result);
- if ($count == 1){
- echo "Login.Success";
- }else{
- echo "Login.Failed";
- }
- ?>
- [/php]
- Visual Basic:
- Create 2 new text boxes. Set the test to username and password (this is just a place holder)
- [/align]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement