Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require 'core/init.php';
- if(isset($_POST["submit"])) {
- // Declaration Variable
- $email = $_POST["email"];
- $password = $_POST["password"];
- // Query Retreived Data
- $query = "SELECT * FROM users WHERE email = '$email'";
- $result = mysqli_query($conn, $query);
- // Checking Data Email
- if(mysqli_num_rows($result) > 0) {
- // Declaration Data Users
- $user = mysqli_fetch_assoc($result);
- if($user["password"] === $password) {
- $_SESSION["user"] = $user["email"];
- header("Location: index.php");
- }
- }
- $error = true;
- }
- ?>
- <?php if(isset($error)) : ?>
- <p style="color: red; font-style: italic;">Your email or password invalid</p>
- <?php endif; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement