Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- echo "<html><body>".
- if ($_POST[]) {
- require 'mysql.php';
- $query = "SELECT * FROM `user` WHERE username='$_POST['username']' and password='$_POST['password']'";
- $result = mysqli_query($connection, $query) or die(mysqli_error($connection));
- $count = mysqli_num_rows($result);
- if ($count != 0) {
- echo "You are logged in as " . $_POST['username'];
- <br><br><a href='$_SERVER['PHP_SELF']'>Logout</a>
- }
- else {
- echo 'Invalid username or password.';
- }
- }
- ."</body></html>";
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement