Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // Database info
- $host = 'localhost';
- $user = 'root';
- $pass = '';
- $database = 'my_talent';
- // Connect to database
- $connect = mysqli_connect($host, $user, $pass, $database);
- // Character set
- mysqli_query($connect, "SET NAMES 'utf8'");
- mysqli_query($connect, 'SET CHARACTER SET utf8');
- ?>
- <!DOCTYPE>
- <html>
- <head>
- <title>Farris Website</title>
- </head>
- <body>
- <?php
- $username = $_POST['username'];
- $q = mysqli_query($connect, "SELECT * FROM users WHERE username = '{$username}'");
- if(mysqli_num_rows($q) > 0){
- echo 'Ok';
- }else{
- echo 'Not';
- }
- ?>
- <form action="" method="POST">
- <input type="text" name="username" />
- <input type="submit" value="Submit" />
- </form>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement