Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <div class="nav-login">
- <form action="login.inc.php" method="post">
- <input type="text" name="username" placeholder="Username"/><br/>
- <input type="password" name="password" placeholder="Password" /><br/><br/>
- <button type="submit" name="submit">login</button>
- </form>
- </div>
- <?php
- if (empty($_POST['username']) || empty($_POST['password'])) {
- echo "Username or Password invaild !";
- } else {
- $conn = mysqli_connect('localhost', 'root', '', 'system');
- if (!$conn){
- die("Connection failed: " . mysqli_connect_error());
- } else {
- $username = $_POST['username'];
- $password = $_POST['password'];
- $query = "SELECT * FROM user WHERE uid='$username' AND pwd='$password';";
- $result = mysqli_query($conn, $query);
- if(mysqli_num_rows($result) > 0) {
- $row = mysqli_fetch_array($result);
- header('Location: profile.php?id=segev');
- } else {
- header('Location: index.php?login=eroor');
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement