I have the following code
$username=htmlspecialchars($_POST['username'],ENT_QUOTES);
$sql="SELECT * FROM user_account WHERE account_name='".$username."'";
Is this vulnerable to sql injection. If so, how could someone manage to bypass this?
I have the following code
$username=htmlspecialchars($_POST['username'],ENT_QUOTES);
$sql="SELECT * FROM user_account WHERE account_name='".$username."'";
Is this vulnerable to sql injection. If so, how could someone manage to bypass this?
Use MySQLi like this
$username = mysqli_real_escape_string($con, $_POST['username']);
$con is your connection
Read this as well