我情况下,下列类型的代码必须插入一个表格:插入双引号到MySQL,并打印出来没有反斜杠
<iframe src="https://www.google.com/maps/embed?pb=!1m14!1m8!1m3!1d3035.058400512634!2d-3.6438669999999997!3d40.473973!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0xd422eea55d33c51%3A0x3294408e8e67eff4!2sClinica+Dental+Artidental!5e0!3m2!1ses!2ses!4v1419779677798" width="600" height="450" frameborder="0" style="border:0"></iframe>
我追赶公布值如下:
$mapLink = htmlspecialchars($_POST['mapLink'], ENT_QUOTES);
和iframe,插入如下:
<iframe src=\"https://www.google.com/maps/embed?pb=!1m14!1m8!1m3!1d3035.058400512634!2d-3.6438669999999997!3d40.473973!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0xd422eea55d33c51%3A0x3294408e8e67eff4!2sClinica+Dental+Artidental!5e0!3m2!1ses!2ses!4v1419779677798\" width=\"600\" height=\"450\" frameborder=\"0\" style=\"border:0\"></iframe>
我怎样才能以接回我怎么做nitial链接"<iframe src..."
用php打印出来,因为它是最初写的?如果没有反斜杠,& QUOT等
更新1
这是我如何插入/更新的MYSQL:
$editCentro = $con->prepare("UPDATE centros SET active = :active, nombre = :nombre, zona = :zona, address = :address,
metro = :metro, zip = :zip, phone = :phone, fax = :fax, email = :email, mapLink = :mapLink, descripcion = :descripcion, horarios = :horarios
WHERE id = ".$centroId);
$editCentro->execute(array(':active'=>$active, ':nombre'=> $nombre, ':zona'=>$zona, ':address'=>$address, ':metro'=>$metro,
':zip'=>$zip, ':phone'=>$telefono, ':fax'=>$fax, ':email'=>$email, ':mapLink'=>$mapLink, ':descripcion'=>$descripcion, ':horarios'=>$horarios));
而且即使不逃逸的价值,它被插了在双引号之前加上反斜杠...
如果您需要原始值,您为什么首先将它转义出来? 'htmlspecialchars'不适用于数据库引用。 – mario
您需要了解实际转义的含义。然后你需要禁用魔术引号。 – SLaks
@mario我逃跑,因为否则双引号与我的PHP搞砸了,并停止插入截断整个值 – samyb8