Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <title>Logging you in... | Project Club</title>
- <?php
- if (session_status() == PHP_SESSION_NONE){session_start();}
- $servername = "censored";
- $serverusername = "censored";
- $serverpassword = "censored";
- $serverdbname = "censored";
- $usernamemail = $_POST['usernamemail'];
- $password = $_POST['password'];
- $conn = new mysqli($servername, $serverusername, $serverpassword, $serverdbname);
- if (isset($_POST['username']) and isset($_POST['password'])){
- $sql = "SELECT * FROM login WHERE username='$usernamemail' OR email='$usernamemail'";
- $result = mysqli_query($conn, $sql);
- if ($row = mysqli_fetch_assoc($result)){
- $hashpwdcheck = password_verify($password, $row['password']);
- echo $hashpwdcheck;
- if ($hashpwdcheck){
- $backbtn = "<br><input type="button" value="Go Back" onclick="window.history.back()" /><style>input{padding:16px 32px;text-align:center;text-decoration:none;display:inline-block;font-size:16px;margin:4px 2px;transition-duration:0.4s;background-color:white;color:black;border:2px solid #f44336;}input:hover{background-color:#f44336;color:white;}html{margin:auto;width:60%;background-color:#d3d3d3;}p{color:black;}</style>";
- $_SESSION['username'] = $row['username'];
- echo "<center><p>You are successfully logged in.</p>" . $backbtn . "</center>";
- }else{
- echo "<center><p>Invalid Login Credentials.</p>" . $backbtn . "</center>";}}
- mysqli_close($conn);
- }else{echo "<center><p>Invalid Login Credentials.</p><br><input type="button" value="Go Back" onclick="window.history.back()" /></center><style>input{padding:16px 32px;text-align:center;text-decoration:none;display:inline-block;font-size:16px;margin:4px 2px;transition-duration:0.4s;background-color:white;color:black;border:2px solid #f44336;}input:hover{background-color:#f44336;color:white;}html{margin:auto;width:60%;background-color:#d3d3d3;}p{color:black;}</style>";};
- ?>
Add Comment
Please, Sign In to add comment