How can I prevent SQL injection in PHP?
//Connect
$unsafe_variable = $_POST["user-input"];
$safe_variable = mysql_real_escape_string($unsafe_variable);
mysql_query("INSERT INTO table (column) VALUES ('" . $safe_variable . "')");
//Disconnect
How can I prevent SQL injection in PHP?
//Connect
$unsafe_variable = $_POST["user-input"];
$safe_variable = mysql_real_escape_string($unsafe_variable);
mysql_query("INSERT INTO table (column) VALUES ('" . $safe_variable . "')");
//Disconnect
prevent SQL injection in PHP?
$str = "<script>alert('Hacked')</script>";
echo htmlentities($str);
how to stop bank entry in php mysql server database
if($name!="" && $email!=""){
$sql="insert into info(name,email)values('".$name."','".$email."')";
$query=mysqli_query($conn,$sql);
}else{
echo "All field are required";
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us