RE: [PHP-DB] The variable $_SERVER['AUTH_USER'] gives domain\\username problem

From: Date: Fri, 01 Oct 2004 00:53:00 +0000
Subject: RE: [PHP-DB] The variable $_SERVER['AUTH_USER'] gives domain\\username problem
Groups: php.db 
Request: Send a blank email to php-db+get-36499@lists.php.net to get a copy of this message
Thanks Ramil, I knew it had something to do with the \, but I still can't figure out how to get the variable into the database without the extra '\' It is entered into the database via a form using the input below: <input name="ident" type="hidden" value="<?php echo $_SERVER[AUTH_USER];?>"> Where would I use the mysql_real_escape_string ? Thanks Justin -----Original Message----- From: Ramil Sagum [mailto:ramil.sagum@gmail.com] Sent: Friday, 1 October 2004 10:46 AM To: Baiocchi, Justin (CSIRO IT, Armidale) Cc: php-db@lists.php.net Subject: Re: [PHP-DB] The variable $_SERVER['AUTH_USER'] gives domain\\username problem On Fri, 1 Oct 2004 10:27:45 +1000, justin.baiocchi@csiro.au <justin.baiocchi@csiro.au> wrote: > Hi, > > When I use the variable $_SERVER['AUTH_USER'] it comes out as > domain\\username when inserted into the MySQL database. So when I try to > update the record looking for a match as below it doesn't work because > the query is looking for where ident=domain\username. > > $result = mysql_query("UPDATE aec SET filename='$filename' WHERE > ident='".$_SERVER['AUTH_USER']."'") or die (mysql_error()); > > Anybody know what I am doing wrong? In MySQL, \ is an escape character. \\ stands for an actual \. for details, just click the link and read on http://www.php.net/manual/en/function.mysql-real-escape-string.php ---- ramil http://ramil.sagum.net

« previous php.db (#36499) next »