Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- RewriteEngine on
- Redirect /Downloads/file1.rar /loginAuth1.php
- Redirect /Downloads/file2.rar /loginAuth2.php
- if(isset($_POST['username']) && isset($_POST['password'])){
- $username = mysqli_real_escape_string($con, $_POST['username']);
- $password = mysqli_real_escape_string($con, md5($_POST['password']));
- $result = mysqli_query($con, "SELECT * FROM `users` WHERE `username` = '$username'") or die(mysqli_error($con));
- if(mysqli_num_rows($result) < 1){
- header("Location: loginAuth1.php?error=incorrect-password");
- }
- while($row = mysqli_fetch_array($result)){
- if($password != $row['password']){
- header("Location: loginAuth1.php?error=incorrect-password");
- }elseif($row['status'] == "0"){
- header("Location: loginAuth1.php?error=banned");
- }else{
- $_SESSION['id'] = $row['id'];
- $_SESSION['username'] = $username;
- $_SESSION['email'] = $row['email'];
- $_SESSION['rank'] = $row['rank'];
- header("Location: Downloadsfile1.rar");
- }
- }
- }
- if(isset($_POST['username']) && isset($_POST['password'])){
- $username = mysqli_real_escape_string($con, $_POST['username']);
- $password = mysqli_real_escape_string($con, md5($_POST['password']));
- $result = mysqli_query($con, "SELECT * FROM `users` WHERE `username` = '$username'") or die(mysqli_error($con));
- if(mysqli_num_rows($result) < 1){
- header("Location: loginAuth2.php?error=incorrect-password");
- }
- while($row = mysqli_fetch_array($result)){
- if($password != $row['password']){
- header("Location: loginAuth2.php?error=incorrect-password");
- }elseif($row['status'] == "0"){
- header("Location: loginAuth2.php?error=banned");
- }else{
- $_SESSION['id'] = $row['id'];
- $_SESSION['username'] = $username;
- $_SESSION['email'] = $row['email'];
- $_SESSION['rank'] = $row['rank'];
- header("Location: Downloadsfile2.rar");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement