我看到很少有攻击者在我的网站上进行攻击,我从一位用户那里得知这是由于我没有对我的login page
. 人们可以尝试多次登录。我想知道如何防止这种情况以及他们用来做什么?所以我可以尝试检查我的网站。请告诉我好的解决方案。
我正在使用语言php
HTML
<form action="login.php" method="post">
<div class="row">
<span id="other-info-font" class="label">Username:<br />or email:</span>
<span class="formw"><input type="text" name="username" value="<?php echo $username; ?>" size="25" /></span>
</div>
<div class="row">
<span id="other-info-font" class="label">Password:</span>
<span class="formw"><input type="password" name="password" value="<?php echo $password; ?>" size="25" /></span>
</div>
<div class="lo-button">
<input class="white" type="submit" value="Login" name="submit-login" />
</div>
</form>
PHP
require_once 'include/global.php';
$error = "";
$username = "";
$password = "";
//check to see if they've submitted the login form
if(isset($_POST['submit-login'])) {
$username = $_POST['username'];
$password = $_POST['password'];
$LoginTool = new Tools();
if($LoginTool->login($username, $password)){
//successful login, redirect them to a page
header("Location: index.php");
}else{
$error = "Incorrect username or password. Please try again.";
}
}