Re: Issues with backslashes and GET data

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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/

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux