Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <form method="post" action="<?php echo htmlspecialchars($_SERVER['PHP_SELF']) ?>" autocomplete="off">
- <label>Email : </label>
- <input type="email" name="email" class="form-control"/><br/>
- <label>Password : </label>
- <input type="password" name="password" class="form-control"/><br/>
- <hr/>
- <input type="submit" class="btn btn-warning" value="Login" name="login"/> or
- <a href="register.php" class="btn btn-success"><span class="glyphicon glyphicon-user"></span> Register an account</a>
- <?php
- if (isset($_POST['login'])) {
- $email = $password = $error = "";
- $email = $_POST['email'];
- $password = md5($_POST['password']);
- if (empty($email) || empty($password)) {
- $error = "Please enter your Email and Password!";
- } else {
- $sql = "SELECT * FROM tbl_users
- WHERE email='$email' && password='$password'";
- $res = mysql_query($sql);
- $user = mysql_num_rows($res);
- if ($user['blocked'] == 'YES') {
- $error = "Your Account has been blocked. Please contact us for more info";
- } else {
- if ($user == 1) {
- $_SESSION['current_user'] = $email;
- header("Location: edit_profile.php");
- exit();
- } else {
- $error = "Wrong Email and Password";
- }
- }
- }
- }
- ?>
- </form>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement