How to remove my backslash while input have underscore

Posted by bob on Stack Overflow See other posts from Stack Overflow or by bob
Published on 2010-04-18T16:25:37Z Indexed on 2010/04/18 16:33 UTC
Read the original article Hit count: 377

Filed under:
|

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 without underscore all backslashes will remove by the stripslashes

Let me know.

© Stack Overflow or respective owner

Related posts about php

Related posts about stripslashes