Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- include('database_1.php');
- if (isset($_POST['submit']))
- {
- $username = trim($_POST['username']);
- $password = trim($_POST['password']);
- $query = "SELECT * FROM users WHERE username='$username' AND password = md5('$password')";
- $resultnew = mysqli_query($mysqli,$query) or die(mysqli_error());
- $num_row = mysqli_num_rows($resultnew);
- $row=mysqli_fetch_array($resultnew);
- if($num_row ==1)
- {
- $_SESSION['user_name']=$row['username'];
- header('Location:filespage.html');
- }
- else
- {
- echo "Invalid login";
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement