Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include('../inc/header.php');
- $username = $_POST['username'];
- $password = $_POST['password'];
- $existscheck = mysql_query("SELECT * FROM users WHERE username = '$username'");
- if ($_POST['username'] != "")
- {
- if ($_POST['password'] != "")
- {
- while($nt=mysql_fetch_array($existscheck)){
- if ($nt[password] == md5($password))
- {
- //SAMPLE LOGIN EVENT
- echo "Login Successful";
- echo "<br>";
- echo $nt[username];
- echo $nt[role];
- //END SAMPLE LOGIN EVENT
- }
- else
- {
- echo "The username or password is wrong. Redirecting to login form...";
- echo "<meta http-equiv=\"Refresh\" content=\"2; url= " . $url ." /login/\">";
- exit;
- }
- }
- }
- else
- {
- echo "Please enter a password. Redirecting to login form...";
- echo "<meta http-equiv=\"Refresh\" content=\"2; url=<?php echo $url; ?>/login/\">";
- exit;
- }
- }
- else
- {
- echo "Please enter a username. Redirecting to login form...";
- echo "<meta http-equiv=\"Refresh\" content=\"2; url=<?php echo $url; ?>/login/\">";
- exit;
- }
- ?>
Add Comment
Please, Sign In to add comment