我在电子邮件地址上使用 mysqli_real_escape_string() ,它返回一个空字符串。它使用任何电子邮件地址执行此操作。
<?php
//from previous page - submitted by user.
$_POST['email']="aehmlo@aehmlo.com";
$_POST['password']='mypass1234';
//Link, I can verify it works.
$mysql_info=array(
"url"=>"url",
"username"=>"username",
"password"=>"password",
"database"=>"database"
);
$link=mysqli_connect($mysql_info['url'],$mysql_info['username'],$mysql_info['password'],$mysql_info['database']);
//Now I attempt to sanitize the user input.
$email=mysqli_real_escape_string($link,$_POST['email']);
$password=sha1(mysqli_real_escape_string($link,$_POST['password']));
var_dump($email);
var_dump($password);?>
我的表的排序规则是“latin1_swedish_ci”。