Relative Content

Tag Archive for phpmysqlwebsecurity

Does this good implements robust security to protect user data from being leaked

<?php if(isset($_COOKIE[‘lgn_tkn’]) && isset($_POST[’email’]) && isset($_POST[‘password’])) { include $_SERVER[‘SERVER_ROOT’].’/lib/connection.php’; if(!$conn) { echo json_encode([“msg”=>”5″]); } else { $stmt = mysqli_prepare($conn,”SELECT * FROM `login-sessions` WHERE `token`=?”); mysqli_stmt_bind_param($stmt,”s”,$_COOKIE[‘lgn_tkn’]); mysqli_stmt_execute($stmt); $result = mysqli_stmt_get_result($stmt); $num_rows = mysqli_num_rows($result); if($num_rows == 1) { while($row = mysqli_fetch_array($result)) { $attempts = $row[‘attemps’]; if($attempts < 0) { $stmt = mysqli_prepare($conn,”SELECT * FROM `users` WHERE `email` […]