|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2001-07-12 02:41 UTC] xyrix at pisem dot net
addslashes() don't properly work.
Before use it, need add this:
$str_any=str_replace("\\","\\\\",$str_any);
and only then:
$str_any=addslashes($str_any);
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 13:00:01 2025 UTC |
$image_file=fopen($HTTP_POST_FILES['imagefile']['tmp_name'],"rb"); unset($upload); while(!feof($image_file)) $upload.=fread($image_file,65535); fclose($image_file); $upload=str_replace("\\","\\\\",$upload); $upload=addslashes($upload); $query_str="INSERT INTO images (id, image_type, image) VALUES('', '".$HTTP_POST_FILES['imagefile']['type']."', '$upload')"; $insert=mysql_query($query_str, $link); Function addslashes don't add slashes '\' before '\', and result is corrupt image.