$value) { $_POST[$key] = mysqli_real_escape_string($conn,str_replace("","",..."/> $value) { $_POST[$key] = mysqli_real_escape_string($conn,str_replace("","",...">

各位看看代码哪里错误了

WBOY
Release: 2016-06-06 20:32:20
Original
1343 people have browsed it

$coon=mysqli_connct($host,$useranme,$password,$db);
mysqli_query($conn,"set names utf8");

foreach ($_POST as $key => $value) {
$_POST[$key] = mysqli_real_escape_string($conn,str_replace("\","\",$value));
}
foreach ($_GET as $key => $value) {
$_GET[$key] = mysqli_real_escape_string($conn,htmlspecialchars ($value,ENT_QUOTES,'UTF-8'));
}

回复内容:

$coon=mysqli_connct($host,$useranme,$password,$db);
mysqli_query($conn,"set names utf8");

foreach ($_POST as $key => $value) {
$_POST[$key] = mysqli_real_escape_string($conn,str_replace("\","\",$value));
}
foreach ($_GET as $key => $value) {
$_GET[$key] = mysqli_real_escape_string($conn,htmlspecialchars ($value,ENT_QUOTES,'UTF-8'));
}

各位看看代码哪里错误了
这个地方的斜线会转义后面的双引号的吧

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template