Issues with backslashes and GET data

From: Date: Wed, 12 Oct 2005 12:03:21 +0000
Subject: Issues with backslashes and GET data
Groups: php.general 
Request: Send a blank email to php-general+get-223953@lists.php.net to get a copy of this message
I use a php page which is supposed to return records from a database table limited to the servername specicified in a drop down menu. 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. I've tried using a regular expression to remove one of the backslashes: $server = ereg_replace("\\", "\", $server); but I can't get this to work either. Any suggestions welcome, I'm running out of ideas. Martin

« previous php.general (#223953) next »