You are here: RE: [PHP] back slashes « PHP « IT news, forums, messages
RE: [PHP] back slashes

Posted by "yanghshiqi" on 07/12/05 20:09

Yeah, mysql_escape_string() will help you.




Best regards,
Shiqi Yang

-----Original Message-----
From: Richard Lynch [mailto:ceo@l-i-e.com]
Sent: Monday, July 11, 2005 9:42 AM
To: Daniel Baughman
Cc: php-general@lists.php.net
Subject: RE: [PHP] back slashes

On Fri, July 8, 2005 12:48 pm, Jay Blanchard said:
> [snip]
> Lets say I have a string:
>
> "c:\www\test"
>
> I want to insert it into a database, but what ends up getting inserted
> is:

PHP3 and earlier:
http://php.net/addslashes

PHP4 (?) and later:
http://php.net/myqsl_escape_string

> c:wwwtest
>
> I can not get php to double the back slashes no matter what I do!
>
> $string = str_replace("\\", "\\\\", $string);

This "should" have worked, for \, but there are other characters to worry
about...

So you must have made a typo or something when you tried this.

--
Like Music?
http://l-i-e.com/artists.htm

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация