开发者

How to remove my backslash while input have underscore

开发者 https://www.devze.com 2022-12-27 02:11 出处:网络
Problem when I enter any input which has underscore (_) data will store to my db looks like this image\\_background.png

Problem when I enter any input which has underscore (_) data will store to my db looks like this image\_background.png

Example

$image = stripslashes($_POST['image']); // example image name image_background.png
$query = 'UPDATE product SET image="'.  $db->string_escape($image, true).'" WHERE id="'. intval($id).'"';

The problem coming when input has underscore only. If wit开发者_JAVA技巧hout underscore all backslashes will remove by the stripslashes

Let me know.


$db->string_escape adding it?
and why do you use stripslashes at all?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号