You are here: Re: [PHP] Issues with backslashes and GET data « PHP « IT news, forums, messages
Re: [PHP] Issues with backslashes and GET data

Posted by Chris Shiflett on 10/12/05 17:18

Martin Selway wrote:
> A servername may contain a backslash e.g. Server1\SQL1.
> When this data is returned from the URL e.g. $server =
> $_GET['server']; The name is returned as Server1\\SQL1,
> so the search fails.

Sounds like magic_quotes_gpc is enabled. Disable it.

> I've tried using a regular expression to remove one of
> the backslashes:
> $server = ereg_replace("\\", "\", $server);

There is a function called stripslashes() that does this. Also, you
should not use a regular expression function when matching literal
strings. Regular expressions are for matching patterns. Use something
like str_replace().

Hope that helps.

Chris

--
Chris Shiflett
Brain Bulb, The PHP Consultancy
http://brainbulb.com/

 

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

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